Staging: this is not the live site, pydocs.org.
builtins Built-in functions, types, exceptions, and other objects.
This module provides direct access to all 'built-in'
identifiers of Python; for example, builtins.len is
the full name for the built-in function len().
This module is not normally accessed explicitly by most
applications, but can be useful in modules that provide
objects with the same name as a built-in value, but in
which the built-in of that name is also needed. © Python Software Foundation. PSF License Version 2 · Official docs ↗
Symbols in builtins _ __debug__ This constant is true if Python was not started with an -O option. a abs Return the absolute value of the argument. agen.__anext__ Returns an awaitable which when run starts to execute the asynchronous generator function or resumes it at the yield expression where the function is currently suspended. agen.aclose Returns an awaitable that when run will throw a GeneratorExit into the underlying asynchronous generator function at the point where it is currently suspended (equivalent to calling athrow(GeneratorE… agen.asend Returns an awaitable which, when run, “sends” a value into the underlying asynchronous generator function: the value argument becomes the result of the current yield expression. agen.athrow Returns an awaitable that, when run, raises an exception at the point where the underlying asynchronous generator function is currently suspended. aiter Return an AsyncIterator for an AsyncIterable object. all Return True if bool(x) is True for all values x in the iterable. anext Return the next item from the async iterator. any Return True if bool(x) is True for any x in the iterable. ascii Return an ASCII-only representation of an object. b bin Return the binary representation of an integer. bool Returns True when the argument is true, False otherwise. bytearray Construct a mutable bytearray object from: - an iterable yielding integers in range(256) - a text string encoded using the specified encoding - a bytes or a buffer object - any object implementing th… bytes Construct an immutable array of bytes from: - an iterable yielding integers in range(256) - a text string encoded using the specified encoding - any object implementing the buffer API. BytesWarning Base class for warnings about bytes and buffer related problems, mostly related to conversion from str or comparing to str. c callable Return whether the object is callable (i.e., some kind of function). chr Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff. codeobject.co_argcount The total number of positional parameters (including positional-only parameters and parameters with default values) that the function has codeobject.co_cellvars A tuple containing the names of local variables that are referenced from at least one nested scope inside the function codeobject.co_code A string representing the sequence of bytecode instructions in the function codeobject.co_freevars A tuple containing the names of free (closure) variables that a nested scope references in an outer scope. codeobject.co_lines Returns an iterator that yields information about successive ranges of bytecodes. codeobject.co_positions Returns an iterable over the source code positions of each bytecode instruction in the code object. codeobject.co_varnames A tuple containing the names of the local variables in the function (starting with the parameter names) codeobject.replace Return a copy of the code object with new values for the specified fields. compile Compile source into a code object that can be executed by exec() or eval(). complex Create a complex number from a string or numbers. contextmanager.__enter__ Enter the runtime context and return either this object or another object related to the runtime context. contextmanager.__exit__ Exit the runtime context and return a Boolean flag indicating if any exception that occurred should be suppressed. copyright Objects that when printed or called, print the text of copyright or credits, respectively. credits Objects that when printed or called, print the text of copyright or credits, respectively. d delattr Deletes the named attribute from the given object. dict (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword … dir If called without an argument, return the names in the current scope. divmod Return the tuple (x//y, x%y). e Ellipsis The same as the ellipsis literal “...”, an object frequently used to indicate that something is omitted. eval Evaluate the given source in the context of globals and locals. Exception Common base class for all non-exit exceptions. ExceptionGroup Both of these exception types wrap the exceptions in the sequence excs. exec Execute the given source in the context of globals and locals. exit Objects that when printed, print a message like “Use quit() or Ctrl-D (i.e. f False The false value of the bool type. file.close Flush any buffers and close the underlying file. file.read Retrieve up to size data from the file. filter Return an iterator yielding those items of iterable for which function(item) is true. float Convert a string or number to a floating-point number, if possible. format Return type(value).__format__(value, format_spec) frame.clear This method clears all references to local variables held by the frame. frame.f_back Points to the previous stack frame (towards the caller), or None if this is the bottom stack frame frame.f_builtins The dictionary used by the frame to look up built-in (intrinsic) names frame.f_generator The generator or coroutine object that owns this frame, or None if the frame is a normal function. frame.f_globals The dictionary used by the frame to look up global variables frame.f_lasti The “precise instruction” of the frame object (this is an index into the bytecode string of the code object) frame.f_lineno The current line number of the frame – writing to this from within a trace function jumps to the given line (only for the bottom-most frame). frame.f_locals The mapping used by the frame to look up local variables. frame.f_trace If not None, this is a function called for various events during code execution (this is used by debuggers). frame.f_trace_lines Set this attribute to False to disable triggering a tracing event for each source line. frozendict object's (key, value) pairs frozendict(iterable) -> new immutable dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v d = frozendict(d) frozendict(**kwargs) -> new immutable dicti… frozenset Build an immutable unordered collection of unique elements. function.__annotate__ The annotate function for this function, or None if the function has no annotations. function.__closure__ None or a tuple of cells that contain bindings for the names specified in the co_freevars attribute of the function’s code object. function.__defaults__ A tuple containing default parameter values for those parameters that have defaults, or None if no parameters have a default value. function.__globals__ A reference to the dictionary that holds the function’s global variables – the global namespace of the module in which the function was defined. FutureWarning Base class for warnings about constructs that will change semantically in the future. g generator.__next__ Starts the execution of a generator function or resumes it at the yield expression where the function is currently suspended. generator.close Raises a GeneratorExit exception at the point where the generator function is currently suspended (equivalent to calling throw(GeneratorExit)). generator.send “Sends” a value into the generator function: the value argument becomes the result of the current yield expression. generator.throw Raises an exception at the point where the generator is currently suspended. genericalias.__args__ This attribute is a tuple (possibly of length 1) of generic types passed to the original __class_getitem__() of the generic class: getattr Get a named attribute from an object. globals Return the dictionary containing the current scope's global variables. h hasattr Return whether the object has an attribute with the given name. hash Return the integer hash value for the given object. help Invoke the built-in help system. hex Return the hexadecimal representation of an integer. i id Return the identity of an object. ImportError Import can't find module, or can't find name in module. ImportWarning Base class for warnings about probable mistakes in module imports input Read a string from standard input. int Convert a number or string to an integer, or return 0 if no arguments are given. IOError Base class for I/O related errors. isinstance Return whether an object is an instance of a class or of a subclass thereof. issubclass Return whether 'cls' is derived from another class or is the same class. iter Get an iterator from an object. l len Return the number of items in a container. license Object that when printed, prints the message “Type license() to see the full license text”, and when called, displays the full license text in a pager-like fashion (one screen at a time). list Built-in mutable sequence. locals Return a dictionary containing the current scope's local variables. m map Make an iterator that computes the function using arguments from each of the iterables. max With a single iterable argument, return its biggest item. memoryview Create a new memoryview object which references the given object. method.__doc__ The method’s documentation (same as method.__func__.__doc__). method.__module__ The name of the module the method was defined in, or None if unavailable. method.__self__ Refers to the class instance object to which the method is bound min With a single iterable argument, return its smallest item. module.__all__ The public names defined by a module are determined by checking the module’s namespace for a variable named __all__; if defined, it must be a sequence of strings which are names defined or imported b… module.__annotate__ The annotate function for this module, or None if the module has no annotations. module.__doc__ The module’s documentation string, or None if unavailable. module.__file__ __file__ is an optional attribute that may or may not be set. module.__loader__ The loader object that the import machinery used to load the module. module.__name__ The name used to uniquely identify the module in the import system. module.__path__ A (possibly empty) sequence of strings enumerating the locations where the package’s submodules will be found. module.__test__ In addition, there are cases when you want tests to be part of a module but not part of the help text, which requires that the tests not be included in the docstring. n next Return the next item from the iterator. None An object frequently used to represent the absence of a value, as when default arguments are not passed to a function. NotImplemented A special value which should be returned by the binary special methods (e.g. o object The base class of the class hierarchy. oct Return the octal representation of an integer. open Open file and return a stream. ord Return the ordinal value of a character. OSError Base class for I/O related errors. p pow Equivalent to base**exp with 2 arguments or base**exp % mod with 3 arguments print Prints the values to a stream, or to sys.stdout by default. q quit Objects that when printed, print a message like “Use quit() or Ctrl-D (i.e. r range Return an object that produces a sequence of integers from start (inclusive) to stop (exclusive) by step. repr Return the canonical string representation of the object. reversed Return a reverse iterator over the values of the given sequence. round Round a number to a given precision in decimal digits. s sentinel Create a unique sentinel object with the given name. sequence.count Return the total number of occurrences of value in sequence. sequence.index Return the index of the first occurrence of value in sequence. sequence.pop Retrieve the item at index and also remove it from sequence. sequence.remove Remove the first item from sequence where sequence[i] == value. set Build an unordered collection of unique elements. setattr Sets the named attribute on the given object to the specified value. slice Create a slice object. sorted Return a new list containing all items from the iterable in ascending order. str Create a new string object from the given object. sum Return the sum of a 'start' value (default: 0) plus an iterable of numbers super Typical use to call a cooperative superclass method: class C(B): def meth(self, arg): super().meth(arg) This works for class methods too: class C(B): @classmethod def cmeth(cls, arg): super().cmeth(a… t TabError Improper mixture of spaces and tabs. True The true value of the bool type. tuple Built-in immutable sequence. type With one argument, return the type of an object. u UnicodeWarning Base class for warnings about Unicode related problems, mostly related to conversion problems. UserWarning Base class for warnings generated by user code. v ValueError Inappropriate argument value (of correct type). vars Without arguments, equivalent to locals(). w Warning Base class for warning categories. z zip The zip object yields n-length tuples, where n is the number of iterables passed as positional arguments to zip().
Python docs © Python Software Foundation · Examples CC0 ·
Source on GitHub · Not affiliated with the PSF