Top Description Fields Constructors Methods
org.python.core

public Class __builtin__

Additional top-level classes in compilation unit: BuiltinFunctions, ImportFunction, SortedFunction, AllFunction, AnyFunction, FormatFunction, PrintFunction, MaxFunction, MinFunction, RoundFunction, CompileFunction, OpenFunction, NextFunction, BinFunction.

extends Object
Class Inheritance
Imports
java.io.FileInputStream, .FileNotFoundException, .IOException, .InputStream, .OutputStream, java.util.Iterator, .Map, org.python.antlr.base.mod, org.python.core.stringlib.IntegerFormatter, org.python.core.util.ExtraMath, .RelativeFile, org.python.modules._functools._functools

The builtin module. All builtin functions are defined here

Field Summary

Modifier and TypeField and Description
public static PyString
private static final PyStringMap

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static PyObject
public static PyObject
__import__(String name, PyObject globals)

public static PyObject
__import__(String name, PyObject globals, PyObject locals)

public static PyObject
__import__(String name, PyObject globals, PyObject locals, PyObject fromlist)

public static PyObject
__import__(String name, PyObject globals, PyObject locals, PyObject fromlist, int level)

public static PyObject
public static PyObject
public static PyObject
public static PyObject
private static String

Returns:

an interned String
asName
(PyObject
a PyObject
name
,
String
name of the python function caller
function
)

Return an interned String from name, raising a TypeError when conversion fails.

public static boolean
public static char
chr(int i)

public static int
public static PyTuple
private static boolean
coerce(PyObject[] objs)

public static void
public static PyObject
public static PyObject
dir()

public static PyObject
public static PyObject
eval(PyObject o, PyObject globals, PyObject locals)

public static PyObject
eval(PyObject o, PyObject globals)

public static PyObject
public static void
execfile(String name, PyObject globals, PyObject locals)

public static void
execfile(String name, PyObject globals)

public static void
public static void
execfile_flags(String name, PyObject globals, PyObject locals, CompilerFlags cflags)

public static void
public static PyObject
public static PyObject
public static PyObject
public static PyObject
public static PyObject
getattr(PyObject obj, PyObject nameObj, PyObject def)

private static int

Returns:

int length of range
getLenOfRangeLongs
(PyObject
PyInteger or PyLong value
lo
,
PyObject
PyInteger or PyLong value
hi
,
PyObject
PyInteger or PyLong value (> 0)
step
)

Return number of items in range (lo, hi, step), when arguments are PyInteger or PyLong objects.

private static PyObject
getRangeLongArgument(PyObject arg, String name)

Helper function for handleRangeLongs.

public static PyObject
public static boolean
hasattr(PyObject obj, PyObject nameObj)

public static PyInteger
public static PyString
public static long
public static PyObject
input(PyObject prompt)

public static PyObject
public static PyString
public static boolean
private static boolean
public static boolean
public static PyObject
public static PyObject
iter(PyObject callable, PyObject sentinel)

public static int
public static PyObject
public static PyObject
map(PyObject[] argstar)

public static PyString
public static final int

Returns:

ordinal value of character or byte value in
ord
(PyObject
string-like object of length 1
c
)

Built-in Python function ord() applicable to the string-like types str, bytearray, unicode.

public static PyObject
public static PyObject
public static PyObject
public static PyObject
range(PyObject start, PyObject stop)

public static PyObject
range(PyObject ilow, PyObject ihigh, PyObject istep)

public static String

Returns:

line of text from the file (encoded as bytes values compatible with PyString)
raw_input
(PyObject
to issue at console before read
prompt
,
PyObject
a file-like object to read from
file
)

Companion to raw_input built-in function used when the interactive interpreter is directed to a file.

public static String

Returns:

line of text from console (encoded as bytes values compatible with PyString)
raw_input
(PyObject
to issue at console before read
prompt
)

Implementation of raw_input(prompt) built-in function using the console indirectly via sys.stdin and sys.stdin.

public static String

Returns:

line of text from console (encoded as bytes values compatible with PyString)
raw_input
()

Implementation of raw_input() built-in function using the console directly.

private static PyString
public static PyObject
public static PyObject
public static PyObject
public static PyObject
public static PyObject
public static PyString
public static PyObject
public static void
setattr(PyObject obj, PyObject name, PyObject value)

public static PyObject
sum(PyObject seq, PyObject result)

public static PyObject
public static PyType
public static int
public static int
unichr(int i)

public static PyObject
vars()

public static PyObject
private static void
public static PyObject
zip()

public static PyObject
zip(PyObject[] argstar)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

__doc__zipback to summary
public static PyString __doc__zip
internedStringsback to summary
private static final PyStringMap internedStrings

Constructor Detail

__builtin__back to summary
public __builtin__()

Method Detail

__import__back to summary
public static PyObject __import__(String name)
__import__back to summary
public static PyObject __import__(String name, PyObject globals)
__import__back to summary
public static PyObject __import__(String name, PyObject globals, PyObject locals)
__import__back to summary
public static PyObject __import__(String name, PyObject globals, PyObject locals, PyObject fromlist)
__import__back to summary
public static PyObject __import__(String name, PyObject globals, PyObject locals, PyObject fromlist, int level)
absback to summary
public static PyObject abs(PyObject o)
applyback to summary
public static PyObject apply(PyObject o)
applyback to summary
public static PyObject apply(PyObject o, PyObject args)
applyback to summary
public static PyObject apply(PyObject o, PyObject args, PyDictionary kws)
asNameback to summary
private static String asName(PyObject name, String function)

Return an interned String from name, raising a TypeError when conversion fails.

Parameters
name:PyObject

a PyObject

function:String

name of the python function caller

Returns:String

an interned String

callableback to summary
public static boolean callable(PyObject obj)
chrback to summary
public static char chr(int i)
cmpback to summary
public static int cmp(PyObject x, PyObject y)
coerceback to summary
public static PyTuple coerce(PyObject o1, PyObject o2)
coerceback to summary
private static boolean coerce(PyObject[] objs)
delattrback to summary
public static void delattr(PyObject obj, PyObject name)
dirback to summary
public static PyObject dir(PyObject o)
dirback to summary
public static PyObject dir()
divmodback to summary
public static PyObject divmod(PyObject x, PyObject y)
evalback to summary
public static PyObject eval(PyObject o, PyObject globals, PyObject locals)
evalback to summary
public static PyObject eval(PyObject o, PyObject globals)
evalback to summary
public static PyObject eval(PyObject o)
execfileback to summary
public static void execfile(String name, PyObject globals, PyObject locals)
execfileback to summary
public static void execfile(String name, PyObject globals)
execfileback to summary
public static void execfile(String name)
execfile_flagsback to summary
public static void execfile_flags(String name, PyObject globals, PyObject locals, CompilerFlags cflags)
fillWithBuiltinsback to summary
public static void fillWithBuiltins(PyObject dict)
filterback to summary
public static PyObject filter(PyObject func, PyObject seq)
filterBaseStringback to summary
public static PyObject filterBaseString(PyObject func, PyBaseString seq, PyType stringType)
filterTupleback to summary
public static PyObject filterTuple(PyObject func, PyTuple seq)
getattrback to summary
public static PyObject getattr(PyObject obj, PyObject name)
getattrback to summary
public static PyObject getattr(PyObject obj, PyObject nameObj, PyObject def)
getLenOfRangeLongsback to summary
private static int getLenOfRangeLongs(PyObject lo, PyObject hi, PyObject step)

Return number of items in range (lo, hi, step), when arguments are PyInteger or PyLong objects. step > 0 required. Return a value < 0 if & only if the true value is too large to fit in an int, or there is an error.

Parameters
lo:PyObject

PyInteger or PyLong value

hi:PyObject

PyInteger or PyLong value

step:PyObject

PyInteger or PyLong value (> 0)

Returns:int

int length of range

getRangeLongArgumentback to summary
private static PyObject getRangeLongArgument(PyObject arg, String name)

Helper function for handleRangeLongs. If arg is int or long object, returns it. If arg is float, raises type error. As a last resort, creates a new int by calling arg type's __int__ method if it is defined.

globalsback to summary
public static PyObject globals()
hasattrback to summary
public static boolean hasattr(PyObject obj, PyObject nameObj)
hashback to summary
public static PyInteger hash(PyObject o)
hexback to summary
public static PyString hex(PyObject o)
idback to summary
public static long id(PyObject o)
inputback to summary
public static PyObject input(PyObject prompt)
inputback to summary
public static PyObject input()
internback to summary
public static PyString intern(PyObject obj)
isinstanceback to summary
public static boolean isinstance(PyObject obj, PyObject cls)
isMappingTypeback to summary
private static boolean isMappingType(PyObject o)
issubclassback to summary
public static boolean issubclass(PyObject derived, PyObject cls)
iterback to summary
public static PyObject iter(PyObject obj)
iterback to summary
public static PyObject iter(PyObject callable, PyObject sentinel)
lenback to summary
public static int len(PyObject obj)
localsback to summary
public static PyObject locals()
mapback to summary
public static PyObject map(PyObject[] argstar)
octback to summary
public static PyString oct(PyObject o)
ordback to summary
public static final int ord(PyObject c) throws PyException

Built-in Python function ord() applicable to the string-like types str, bytearray, unicode.

Parameters
c:PyObject

string-like object of length 1

Returns:int

ordinal value of character or byte value in

Exceptions
PyException:
TypeError if not a string-like type

powback to summary
public static PyObject pow(PyObject x, PyObject y)
powback to summary
public static PyObject pow(PyObject x, PyObject y, PyObject z)
rangeback to summary
public static PyObject range(PyObject n)
rangeback to summary
public static PyObject range(PyObject start, PyObject stop)
rangeback to summary
public static PyObject range(PyObject ilow, PyObject ihigh, PyObject istep)
raw_inputback to summary
public static String raw_input(PyObject prompt, PyObject file)

Companion to raw_input built-in function used when the interactive interpreter is directed to a file.

Parameters
prompt:PyObject

to issue at console before read

file:PyObject

a file-like object to read from

Returns:String

line of text from the file (encoded as bytes values compatible with PyString)

raw_inputback to summary
public static String raw_input(PyObject prompt)

Implementation of raw_input(prompt) built-in function using the console indirectly via sys.stdin and sys.stdin.

Parameters
prompt:PyObject

to issue at console before read

Returns:String

line of text from console (encoded as bytes values compatible with PyString)

raw_inputback to summary
public static String raw_input()

Implementation of raw_input() built-in function using the console directly.

Returns:String

line of text from console (encoded as bytes values compatible with PyString)

readlineback to summary
private static PyString readline(PyObject file)
reduceback to summary
public static PyObject reduce(PyObject f, PyObject l, PyObject z)
reduceback to summary
public static PyObject reduce(PyObject f, PyObject l)
reloadback to summary
public static PyObject reload(PyObject o)
reloadback to summary
public static PyObject reload(PyModule o)
reloadback to summary
public static PyObject reload(PySystemState o)
reprback to summary
public static PyString repr(PyObject o)
reversedback to summary
public static PyObject reversed(PyObject seq)
setattrback to summary
public static void setattr(PyObject obj, PyObject name, PyObject value)
sumback to summary
public static PyObject sum(PyObject seq, PyObject result)
sumback to summary
public static PyObject sum(PyObject seq)
typeback to summary
public static PyType type(PyObject o)
unichrback to summary
public static int unichr(PyObject obj)
unichrback to summary
public static int unichr(int i)
varsback to summary
public static PyObject vars()
varsback to summary
public static PyObject vars(PyObject o)
verify_mappingsback to summary
private static void verify_mappings(PyObject globals, PyObject locals)
zipback to summary
public static PyObject zip()
zipback to summary
public static PyObject zip(PyObject[] argstar)