On this page
- builtins
- Exploring Built-ins
- Built-ins by Category
- Core Data Types & Collections
- Math & Aggregation
- Iteration & Functional
- Object Introspection & Attributes
- Classes & Descriptors
- String, Character & Formatting
- I/O, Execution & Debugging
- Built-in Constants & REPL Helpers
- Alphabetical Index (All 80 Standard Built-ins)
builtins
Prev: python3 | Up: python3 | Next: stdlib_module
Rel: python3, stdlib_module, builtins
Ref: docs.python.org — Built-in Functions | Built-in Types | Built-in Constants
Tags: #public #python3 #builtins #index
Exploring Built-ins
import builtins
for x in sorted(dir(builtins)):
if not x.startswith('_'):
print(f'[[{x}]]')
Built-ins by Category
Core Data Types & Collections
bool, int, float, complex, str, bytes, bytearray, memoryview, list, tuple, range, dict, set, frozenset, slice, object, type
Math & Aggregation
abs, divmod, max, min, pow, round, sum
Iteration & Functional
all, any, enumerate, filter, iter, aiter, len, map, next, anext, reversed, sorted, zip
Object Introspection & Attributes
callable, delattr, dir, getattr, hasattr, hash, id, isinstance, issubclass, repr, setattr, vars
Classes & Descriptors
classmethod, property, staticmethod, super
String, Character & Formatting
ascii, bin, chr, format, hex, oct, ord
I/O, Execution & Debugging
breakpoint, compile, eval, exec, globals, input, locals, open, print
Built-in Constants & REPL Helpers
True, False, None, Ellipsis, NotImplemented, copyright, credits, exit, help, license, quit
Alphabetical Index (All 80 Standard Built-ins)
- Ellipsis — The type of the Ellipsis singleton.
- False — Returns True when the argument is true, False otherwise.
- None — The type of the None singleton.
- NotImplemented — The type of the NotImplemented singleton.
- True — Returns True when the argument is true, False otherwise.
- abs — Return the absolute value of the argument.
- 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.
- bin — Return the binary representation of an integer.
- bool — Returns True when the argument is true, False otherwise.
- breakpoint — Call sys.breakpointhook(*args, **kws). sys.breakpointhook() must accept whatever arguments are passed.
- bytearray — bytearray(string, encoding[, errors]) -> bytearray bytearray(bytes_or_buffer) -> mutable copy of bytes_or_buffer bytearray(int) -> bytes array of size given by the parameter initialized with null bytes
- bytes — bytes(string, encoding[, errors]) -> bytes bytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer bytes(int) -> bytes object of size given by the parameter initialized with null bytes
- 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.
- classmethod — Convert a function to be a class method.
- 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.
- copyright — interactive prompt objects for printing the license text, a list of contributors and the copyright notice.
- credits — interactive prompt objects for printing the license text, a list of contributors and the copyright notice.
- delattr — Deletes the named attribute from the given object.
- dict — dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via:
- dir — If called without an argument, return the names in the current scope.
- divmod — Return the tuple (x//y, x%y). Invariant: div*y + mod == x.
- enumerate — Return an enumerate object.
- eval — Evaluate the given source in the context of globals and locals.
- exec — Execute the given source in the context of globals and locals.
- exit —
- filter — Return an iterator yielding those items of iterable for which function(item) is true. If function is None, return the items that are true.
- float — Convert a string or number to a floating-point number, if possible.
- format — Return type(value).format(value, format_spec) Many built-in types implement format_spec according to the Format Specification Mini-language. See help('FORMATTING').
- frozenset — Build an immutable unordered collection of unique elements.
- getattr — Get a named attribute from an object.
- globals — Return the dictionary containing the current scope's global variables.
- hasattr — Return whether the object has an attribute with the given name.
- hash — Return the integer hash value for the given object.
- help — Define the builtin 'help'.
- hex — Return the hexadecimal representation of an integer.
- id — Return the identity of an object.
- input — Read a string from standard input. The trailing newline is stripped.
- int — int(x, base=10) -> integer Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating-point
- 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 — iter(callable, sentinel) -> iterator Get an iterator from an object. In the first form, the argument must supply its own iterator, or be a sequence.
- len — Return the number of items in a container.
- license — interactive prompt objects for printing the license text, a list of contributors and the copyright notice.
- list — Built-in mutable sequence.
- locals — Return a dictionary containing the current scope's local variables.
- map — Make an iterator that computes the function using arguments from each of the iterables. Stops when the shortest iterable is exhausted.
- max — max(arg1, arg2, *args, *[, key=func]) -> value With a single iterable argument, return its biggest item. The default keyword-only argument specifies an object to return if
- memoryview — Create a new memoryview object which references the given object.
- min — min(arg1, arg2, *args, *[, key=func]) -> value With a single iterable argument, return its smallest item. The default keyword-only argument specifies an object to return if
- next — Return the next item from the iterator. If default is given and the iterator is exhausted, it is returned instead of raising StopIteration.
- object — The base class of the class hierarchy.
- oct — Return the octal representation of an integer.
- open — Open file and return a stream. Raise OSError upon failure.
- ord — Return the ordinal value of a character.
- pow — Equivalent to baseexp with 2 arguments or baseexp % mod with 3 arguments Some types, such as ints, are able to use a more efficient algorithm when invoked using the three argument form.
- print — Prints the values to a stream, or to sys.stdout by default.
- property — Property attribute.
- quit —
- range — range(start, stop[, step]) -> range object Return an object that produces a sequence of integers from start (inclusive) to stop (exclusive) by step. range(i, j) produces i, i+1, i+2, ..., j-1.
- 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.
- set — Build an unordered collection of unique elements.
- setattr — Sets the named attribute on the given object to the specified value.
- slice — slice(start, stop[, step]) Create a slice object.
- sorted — Return a new list containing all items from the iterable in ascending order.
- staticmethod — Convert a function to be a static method.
- str — str(bytes_or_buffer[, encoding[, errors]]) -> str Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer
- sum — Return the sum of a 'start' value (default: 0) plus an iterable of numbers When the iterable is empty, return the start value.
- super — super(type) -> unbound super object super(type, obj) -> bound super object; requires isinstance(obj, type) super(type, type2) -> bound super object; requires
- tuple — Built-in immutable sequence.
- type — type(name, bases, dict, **kwds) -> a new type
- vars — Without arguments, equivalent to locals().
- zip — The zip object yields n-length tuples, where n is the number of iterables passed as positional arguments to zip(). The i-th element in every tuple comes from the i-th iterable argument to zip(). This
Linked from
Related notes
- tuts/python3 Linked here; links to this page; shared tags: #index
- tuts/python3/stdlib_module Linked here; links to this page; shared tags: #index
- tuts/python3/__builtins__/abs Linked here; shared tags: #builtins
- tuts/python3/__builtins__/aiter Linked here; shared tags: #builtins
- tuts/python3/__builtins__/all Linked here; shared tags: #builtins
- tuts/python3/__builtins__/anext Linked here; shared tags: #builtins
- tuts/python3/__builtins__/any Linked here; shared tags: #builtins
- tuts/python3/__builtins__/ascii Linked here; shared tags: #builtins
- tuts/python3/__builtins__/bin Linked here; shared tags: #builtins
- tuts/python3/__builtins__/bool Linked here; shared tags: #builtins