Skip to content

Latest commit

 

History

History
199 lines (104 loc) · 2.89 KB

builtins.rst

File metadata and controls

199 lines (104 loc) · 2.89 KB

Builtin functions and exceptions

All builtin functions and exceptions are described here. They are also available via builtins module.

Functions and types

abs()

all()

any()

bin()

python:bytes.

callable()

chr()

classmethod()

compile()

delattr(obj, name)

The argument name should be a string, and this function deletes the named attribute from the object given by obj.

dir()

divmod()

enumerate()

eval()

exec()

filter()

getattr()

globals()

hasattr()

hash()

hex()

id()

input()

from_bytes(bytes, byteorder)

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

to_bytes(size, byteorder)

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

isinstance()

issubclass()

iter()

len()

locals()

map()

max()

min()

next()

oct()

open()

ord()

pow()

print()

property()

range()

repr()

reversed()

round()

setattr()

The slice builtin is the type that slice objects have.

sorted()

staticmethod()

sum()

super()

type()

zip()

Exceptions

AssertionError

AttributeError

Exception

ImportError

IndexError

KeyboardInterrupt

KeyError

MemoryError

NameError

NotImplementedError

OSError

python:OSError. MicroPython doesn't implement errno attribute, instead use the standard way to access exception arguments: exc.args[0].

RuntimeError

StopIteration

SyntaxError

SystemExit

python:SystemExit.

TypeError

python:TypeError.

ValueError

ZeroDivisionError