This is the documentation for the latest development branch of MicroPython and may refer to features that are not available in released versions.

If you are looking for the documentation for a specific release, use the drop-down menu on the left and select the desired version.

builtins – builtin functions and exceptions

All builtin functions and exceptions are described here. They are alsoavailable viabuiltins module.

Functions and types

abs()
all()
any()
bin()
classbool
classbytearray

See CPython documentation:bytearray.

classbytes

See CPython documentation:bytes.

callable()
chr()
classmethod()
compile()
classcomplex
delattr(obj,name)

The argumentname should be a string, and this function deletes the namedattribute from the object given byobj.

classdict
dir()
divmod()
enumerate()
eval()
exec()
filter()
classfloat
classfrozenset
getattr()
globals()
hasattr()
hash()
hex()
id()
input()
classint
classmethodfrom_bytes(bytes,byteorder)

In MicroPython,byteorder parameter must be positional (this iscompatible with CPython).

to_bytes(size,byteorder)

In MicroPython,byteorder parameter must be positional (this iscompatible with CPython).

Note

The optionalsigned kwarg from CPython is not supported.MicroPython currently converts negative integers as signed,and positive as unsigned. (Details.)

isinstance()
issubclass()
iter()
len()
classlist
locals()
map()
max()
classmemoryview

See CPython documentation:memoryview.

min()
next()
classobject
oct()
open()
ord()
pow()
print()
property()
range()
repr()
reversed()
round()
classset
setattr()
classslice

Theslice builtin is the type that slice objects have.

sorted()
staticmethod()
classstr
sum()
super()
classtuple
type()
zip()

Exceptions

exceptionAssertionError
exceptionAttributeError
exceptionException
exceptionImportError
exceptionIndexError
exceptionKeyboardInterrupt

See CPython documentation:KeyboardInterrupt.

See also in the context ofSoft Bricking (failure to boot).

exceptionKeyError
exceptionMemoryError
exceptionNameError
exceptionNotImplementedError
exceptionOSError
exceptionRuntimeError
exceptionStopIteration
exceptionSyntaxError
exceptionSystemExit

See CPython documentation:SystemExit.

On non-embedded ports (i.e. Windows and Unix), an unhandledSystemExitexits the MicroPython process in a similar way to CPython.

On embedded ports, an unhandledSystemExit currently causes aSoft Reset of MicroPython.

exceptionTypeError

See CPython documentation:TypeError.

exceptionValueError
exceptionZeroDivisionError