__builtin__

Built-in functions, exceptions, and other objects.

Noteworthy: None is the `nil’ object; Ellipsis represents `...’ in slices.

Functions

abs((number) -> number) Return the absolute value of the argument.
all((iterable) -> bool) Return True if bool(x) is True for all values x in the iterable.
any((iterable) -> bool) Return True if bool(x) is True for any x in the iterable.
apply((object[, args[, kwargs]]) -> value) Call a callable object with positional arguments taken from the tuple args, and keyword arguments taken from the optional dictionary kwargs.
bin((number) -> string) Return the binary representation of an integer or long integer.
callable((object) -> bool) Return whether the object is callable (i.e., some kind of function).
chr((i) -> character) Return a string of one character with ordinal i; 0 <= i < 256.
cmp((x, y) -> integer) Return negative if x<y, zero if x==y, positive if x>y.
coerce(x, y) -> (x1, y1) Return a tuple consisting of the two numeric arguments converted to a common type, using the same rules as used by arithmetic operations.
compile((source, filename, mode[, flags[, ...) Compile the source string (a Python module, statement or expression) into a code object that can be executed by the exec statement or eval().
delattr(object, name) Delete a named attribute on an object; delattr(x, ‘y’) is equivalent to ``del x.y’‘.
dir(([object]) -> list of strings) If called without an argument, return the names in the current scope.
divmod(x, y) -> (quotient, remainder) Return the tuple (x//y, x%y).
eval((source[, globals[, locals]]) -> value) Evaluate the source in the context of globals and locals.
execfile(filename[, globals[, locals]]) Read and execute a Python script from a file.
filter((function or None, sequence) -> list, ...) Return those items of sequence for which function(item) is true.
format((value[, format_spec]) -> string) Returns value.__format__(format_spec)
getattr((object, name[, default]) -> value) Get a named attribute from an object; getattr(x, ‘y’) is equivalent to x.y.
globals(() -> dictionary) Return the dictionary containing the current scope’s global variables.
hasattr((object, name) -> bool) Return whether the object has an attribute with the given name.
hash((object) -> integer) Return a hash value for the object.
hex((number) -> string) Return the hexadecimal representation of an integer or long integer.
id((object) -> integer) Return the identity of an object.
input(([prompt]) -> value) Equivalent to eval(raw_input(prompt)).
intern((string) -> string) ``Intern’’ the given string. This enters the string in the (global)
isinstance((object, ...) Return whether an object is an instance of a class or of a subclass thereof.
issubclass((C, B) -> bool) Return whether class C is a subclass (i.e., a derived class) of class B.
iter((collection) -> iterator) iter(callable, sentinel) -> iterator
len((object) -> integer) Return the number of items of a sequence or collection.
locals(() -> dictionary) Update and return a dictionary containing the current scope’s local variables.
map((function, sequence[, sequence, ...) Return a list of the results of applying the function to the items of the argument sequence(s).
max((iterable[[, key]) max(a, b, c, ...[, key=func]) -> value
min((iterable[[, key]) min(a, b, c, ...[, key=func]) -> value
next(iterator[, default]) Return the next item from the iterator.
oct((number) -> string) Return the octal representation of an integer or long integer.
open((name[, mode[, buffering]]) -> file object) Open a file using the file() type, returns a file object.
ord((c) -> integer) Return the integer ordinal of a one-character string.
pow((x, y[, z]) -> number) With two arguments, equivalent to x**y.
print(value, ...[, sep, end, file]) Prints the values to a stream, or to sys.stdout by default.
range((stop) -> list of integers) range(start, stop[, step]) -> list of integers
raw_input(([prompt]) -> string) Read a string from standard input.
reduce((function, sequence[, initial]) -> value) Apply a function of two arguments cumulatively to the items of a sequence, from left to right, so as to reduce the sequence to a single value.
reload((module) -> module) Reload the module.
repr((object) -> string) Return the canonical string representation of the object.
round((number[, ...) Round a number to a given precision in decimal digits (default 0 digits).
setattr(object, name, value) Set a named attribute on an object; setattr(x, ‘y’, v) is equivalent to ``x.y = v’‘.
sorted sorted(iterable, cmp=None, key=None, reverse=False) –> new sorted list
sum((sequence[, start]) -> value) Return the sum of a sequence of numbers (NOT strings) plus the value of parameter ‘start’ (which defaults to 0).
unichr((i) -> Unicode character) Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff.
vars(([object]) -> dictionary) Without arguments, equivalent to locals().
zip((seq1 [, seq2 [...]]) -> [(seq1[0], ...) Return a list of tuples, where each tuple contains the i-th element from each of the argument sequences.

Classes

basestring Type basestring cannot be instantiated; it is the base for str and unicode.
bool Returns True when the argument x is true, False otherwise.
buffer Create a new buffer object which references the given object.
bytearray bytearray(string, encoding[, errors]) -> bytearray.
bytes alias of str
classmethod Convert a function to be a class method.
complex Create a complex number from a real part and an optional imaginary part.
dict
enumerate Return an enumerate object.
file Open a file.
float Convert a string or number to a floating point number, if possible.
frozenset frozenset(iterable) -> frozenset object
int int(x, base=10) -> int or long
list list(iterable) -> new list initialized from iterable’s items
long long(x, base=10) -> long
memoryview Create a new memoryview object which references the given object.
object The most base type
property fget is a function to be used for getting an attribute value, and likewise
reversed Return a reverse iterator
set set(iterable) -> new set object
slice Create a slice object.
staticmethod Convert a function to be a static method.
str Return a nice string representation of the object.
super
tuple tuple(iterable) -> tuple initialized from iterable’s items
type type(name, bases, dict) -> a new type
unicode unicode(string[, encoding[, errors]]) -> unicode object
xrange xrange(start, stop[, step]) -> xrange object

Exceptions

ArithmeticError Base class for arithmetic errors.
AssertionError Assertion failed.
AttributeError Attribute not found.
BaseException Common base class for all exceptions
BufferError Buffer error.
BytesWarning Base class for warnings about bytes and buffer related problems, mostly related to conversion from str or comparing to str.
DeprecationWarning Base class for warnings about deprecated features.
EOFError Read beyond end of file.
EnvironmentError Base class for I/O related errors.
Exception Common base class for all non-exit exceptions.
FloatingPointError Floating point operation failed.
FutureWarning Base class for warnings about constructs that will change semantically in the future.
GeneratorExit Request that a generator exit.
IOError I/O operation failed.
ImportError Import can’t find module, or can’t find name in module.
ImportWarning Base class for warnings about probable mistakes in module imports
IndentationError Improper indentation.
IndexError Sequence index out of range.
KeyError Mapping key not found.
KeyboardInterrupt Program interrupted by user.
LookupError Base class for lookup errors.
MemoryError Out of memory.
NameError Name not found globally.
NotImplementedError Method or function hasn’t been implemented yet.
OSError OS system call failed.
OverflowError Result too large to be represented.
PendingDeprecationWarning Base class for warnings about features which will be deprecated in the future.
ReferenceError Weak ref proxy used after referent went away.
RuntimeError Unspecified run-time error.
RuntimeWarning Base class for warnings about dubious runtime behavior.
StandardError Base class for all standard Python exceptions that do not represent interpreter exiting.
StopIteration Signal the end from iterator.next().
SyntaxError Invalid syntax.
SyntaxWarning Base class for warnings about dubious syntax.
SystemError Internal error in the Python interpreter.
SystemExit Request to exit from the interpreter.
TabError Improper mixture of spaces and tabs.
TypeError Inappropriate argument type.
UnboundLocalError Local name referenced but not bound to a value.
UnicodeDecodeError Unicode decoding error.
UnicodeEncodeError Unicode encoding error.
UnicodeError Unicode related error.
UnicodeTranslateError Unicode translation error.
UnicodeWarning Base class for warnings about Unicode related problems, mostly related to conversion problems.
UserWarning Base class for warnings generated by user code.
ValueError Inappropriate argument value (of correct type).
Warning Base class for warning categories.
ZeroDivisionError Second argument to a division or modulo operation was zero.