組込みの関数と例外

組込みの関数と例外のすべては、ここで説明します。これらは``builtins`` モジュール経由でも利用できます。

関数とデータ型

abs()
all()
any()
bin()
class bool
class bytearray
class bytes

CPython のドキュメンテーションを参照してください: bytes.

callable()
chr()
classmethod()
compile()
class complex
delattr(obj, name)

引数 name は文字列でなければならず、この関数は obj で与えたオブジェクトから、指定された名前の属性を削除します。

class dict
dir()
divmod()
enumerate()
eval()
exec()
filter()
class float
class frozenset
getattr()
globals()
hasattr()
hash()
hex()
id()
input()
class int
classmethod from_bytes(bytes, byteorder)

MicroPython では byteorder は位置パラメータでなければなりません(位置パラメータとすることは CPython でも可能です)。

to_bytes(size, byteorder)

MicroPython では byteorder は位置パラメータでなければなりません(位置パラメータとすることは CPython でも可能です)。

isinstance()
issubclass()
iter()
len()
class list
locals()
map()
max()
class memoryview
min()
next()
class object
oct()
open()
ord()
pow()
print()
property()
range()
repr()
reversed()
round()
class set
setattr()
class slice

slice 組込み型は、スライスオブジェクトが持つデータ型です。

sorted()
staticmethod()
class str
sum()
super()
class tuple
type()
zip()

例外

exception AssertionError
exception AttributeError
exception Exception
exception ImportError
exception IndexError
exception KeyboardInterrupt
exception KeyError
exception MemoryError
exception NameError
exception NotImplementedError
exception OSError

CPython のドキュメンテーションを参照してください: python:OSError 。MicroPython は errno 属性を実装しておらず、代わりに標準的な方法 exc.args[0] で例外引数にアクセスします。

exception RuntimeError
exception StopIteration
exception SyntaxError
exception SystemExit

CPython のドキュメンテーションを参照してください: SystemExit.

exception TypeError

CPython のドキュメンテーションを参照してください: TypeError.

exception ValueError
exception ZeroDivisionError