2021-08-16 14:07:46 +01:00
|
|
|
:mod:`builtins` -- builtin functions and exceptions
|
|
|
|
===================================================
|
2016-06-08 22:24:52 +01:00
|
|
|
|
2017-06-24 21:45:38 +01:00
|
|
|
All builtin functions and exceptions are described here. They are also
|
|
|
|
available via ``builtins`` module.
|
|
|
|
|
2017-07-01 20:20:49 +01:00
|
|
|
Functions and types
|
|
|
|
-------------------
|
2016-06-08 22:24:52 +01:00
|
|
|
|
|
|
|
.. function:: abs()
|
|
|
|
|
|
|
|
.. function:: all()
|
|
|
|
|
|
|
|
.. function:: any()
|
|
|
|
|
|
|
|
.. function:: bin()
|
|
|
|
|
|
|
|
.. class:: bool()
|
|
|
|
|
|
|
|
.. class:: bytearray()
|
|
|
|
|
|
|
|
.. class:: bytes()
|
|
|
|
|
2017-07-02 13:37:31 +01:00
|
|
|
|see_cpython| `python:bytes`.
|
|
|
|
|
2016-06-08 22:24:52 +01:00
|
|
|
.. function:: callable()
|
|
|
|
|
|
|
|
.. function:: chr()
|
|
|
|
|
|
|
|
.. function:: classmethod()
|
|
|
|
|
|
|
|
.. function:: compile()
|
|
|
|
|
|
|
|
.. class:: complex()
|
|
|
|
|
2016-10-25 01:02:47 +01:00
|
|
|
.. function:: delattr(obj, name)
|
|
|
|
|
|
|
|
The argument *name* should be a string, and this function deletes the named
|
|
|
|
attribute from the object given by *obj*.
|
|
|
|
|
2016-06-08 22:24:52 +01:00
|
|
|
.. class:: dict()
|
|
|
|
|
|
|
|
.. function:: dir()
|
|
|
|
|
|
|
|
.. function:: divmod()
|
|
|
|
|
|
|
|
.. function:: enumerate()
|
|
|
|
|
|
|
|
.. function:: eval()
|
|
|
|
|
|
|
|
.. function:: exec()
|
|
|
|
|
|
|
|
.. function:: filter()
|
|
|
|
|
|
|
|
.. class:: float()
|
|
|
|
|
|
|
|
.. class:: frozenset()
|
|
|
|
|
|
|
|
.. function:: getattr()
|
|
|
|
|
|
|
|
.. function:: globals()
|
|
|
|
|
|
|
|
.. function:: hasattr()
|
|
|
|
|
|
|
|
.. function:: hash()
|
|
|
|
|
|
|
|
.. function:: hex()
|
|
|
|
|
|
|
|
.. function:: id()
|
|
|
|
|
|
|
|
.. function:: input()
|
|
|
|
|
|
|
|
.. class:: int()
|
|
|
|
|
2017-04-08 22:06:54 +01:00
|
|
|
.. classmethod:: from_bytes(bytes, byteorder)
|
|
|
|
|
|
|
|
In MicroPython, `byteorder` parameter must be positional (this is
|
|
|
|
compatible with CPython).
|
|
|
|
|
|
|
|
.. method:: to_bytes(size, byteorder)
|
|
|
|
|
|
|
|
In MicroPython, `byteorder` parameter must be positional (this is
|
|
|
|
compatible with CPython).
|
|
|
|
|
2016-06-08 22:24:52 +01:00
|
|
|
.. function:: isinstance()
|
|
|
|
|
|
|
|
.. function:: issubclass()
|
|
|
|
|
|
|
|
.. function:: iter()
|
|
|
|
|
|
|
|
.. function:: len()
|
|
|
|
|
|
|
|
.. class:: list()
|
|
|
|
|
|
|
|
.. function:: locals()
|
|
|
|
|
|
|
|
.. function:: map()
|
|
|
|
|
|
|
|
.. function:: max()
|
|
|
|
|
|
|
|
.. class:: memoryview()
|
|
|
|
|
|
|
|
.. function:: min()
|
|
|
|
|
|
|
|
.. function:: next()
|
|
|
|
|
|
|
|
.. class:: object()
|
|
|
|
|
|
|
|
.. function:: oct()
|
|
|
|
|
|
|
|
.. function:: open()
|
|
|
|
|
|
|
|
.. function:: ord()
|
|
|
|
|
|
|
|
.. function:: pow()
|
|
|
|
|
|
|
|
.. function:: print()
|
|
|
|
|
|
|
|
.. function:: property()
|
|
|
|
|
|
|
|
.. function:: range()
|
|
|
|
|
|
|
|
.. function:: repr()
|
|
|
|
|
|
|
|
.. function:: reversed()
|
|
|
|
|
|
|
|
.. function:: round()
|
|
|
|
|
|
|
|
.. class:: set()
|
|
|
|
|
|
|
|
.. function:: setattr()
|
|
|
|
|
2016-10-25 01:02:47 +01:00
|
|
|
.. class:: slice()
|
|
|
|
|
|
|
|
The *slice* builtin is the type that slice objects have.
|
|
|
|
|
2016-06-08 22:24:52 +01:00
|
|
|
.. function:: sorted()
|
|
|
|
|
|
|
|
.. function:: staticmethod()
|
|
|
|
|
|
|
|
.. class:: str()
|
|
|
|
|
|
|
|
.. function:: sum()
|
|
|
|
|
|
|
|
.. function:: super()
|
|
|
|
|
|
|
|
.. class:: tuple()
|
|
|
|
|
|
|
|
.. function:: type()
|
|
|
|
|
|
|
|
.. function:: zip()
|
2017-06-24 21:45:38 +01:00
|
|
|
|
|
|
|
|
|
|
|
Exceptions
|
|
|
|
----------
|
|
|
|
|
2017-07-01 20:20:49 +01:00
|
|
|
.. exception:: AssertionError
|
|
|
|
|
2017-06-24 21:45:38 +01:00
|
|
|
.. exception:: AttributeError
|
|
|
|
|
|
|
|
.. exception:: Exception
|
|
|
|
|
|
|
|
.. exception:: ImportError
|
|
|
|
|
|
|
|
.. exception:: IndexError
|
|
|
|
|
|
|
|
.. exception:: KeyboardInterrupt
|
|
|
|
|
|
|
|
.. exception:: KeyError
|
|
|
|
|
|
|
|
.. exception:: MemoryError
|
|
|
|
|
|
|
|
.. exception:: NameError
|
|
|
|
|
|
|
|
.. exception:: NotImplementedError
|
|
|
|
|
|
|
|
.. exception:: OSError
|
|
|
|
|
|
|
|
.. exception:: RuntimeError
|
|
|
|
|
|
|
|
.. exception:: StopIteration
|
|
|
|
|
2017-07-01 20:20:49 +01:00
|
|
|
.. exception:: SyntaxError
|
|
|
|
|
2017-06-24 21:45:38 +01:00
|
|
|
.. exception:: SystemExit
|
|
|
|
|
2017-07-02 13:37:31 +01:00
|
|
|
|see_cpython| `python:SystemExit`.
|
|
|
|
|
2017-06-24 21:45:38 +01:00
|
|
|
.. exception:: TypeError
|
|
|
|
|
2017-07-02 13:37:31 +01:00
|
|
|
|see_cpython| `python:TypeError`.
|
|
|
|
|
2017-06-24 21:45:38 +01:00
|
|
|
.. exception:: ValueError
|
2017-07-01 20:20:49 +01:00
|
|
|
|
|
|
|
.. exception:: ZeroDivisionError
|