このドキュメンテーションは、MicroPython の最新開発ブランチのためのものです。 リリースバージョンでは利用できない機能に言及することがあります。

特定のリリースのドキュメントをお探しの場合は、左側のドロップダウンメニューを使って、 望みのバージョンを選択します。

builtins -- 組込みの関数と例外

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

関数とデータ型

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

CPython のドキュメンテーションを参照してください: 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 でも可能です)。

注釈

CPython にあるオプションの signed キーワード引数はサポートしていません。MicroPython は、現在のところ負の整数は符号付き、正の整数は符号なしとして変換します。 (詳細.)

isinstance()
issubclass()
iter()
len()
class list
locals()
map()
max()
class memoryview

CPython のドキュメンテーションを参照してください: 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

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

ソフトブリッキング(起動失敗) の記載も参照してください。

exception KeyError
exception MemoryError
exception NameError
exception NotImplementedError
exception OSError
exception RuntimeError
exception StopIteration
exception SyntaxError
exception SystemExit

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

組込み系ではないポート(WindowsやUnixなど)では、処理されない SystemExit が発生すると、CPython と同様にMicroPythonプロセスが終了します。

一方、組込み系のポートでは、現在のところ処理されない SystemExit が発生すると MicroPython の ソフトリセット が行われます。

exception TypeError

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

exception ValueError
exception ZeroDivisionError