内置函数和异常¶
此处描述了所有内置函数和异常。它们也可以通过builtins 模块获得。
功能和类型¶
由于空间原因,并非所有这些功能和类型都在所有 CircuitPython 端口中打开。
-
abs()¶
-
all()¶
-
any()¶
-
bin()¶
-
class
bool¶
-
class
bytearray¶
-
callable()¶
-
chr()¶
-
classmethod()¶
-
compile()¶
-
class
complex¶
-
delattr(obj, name)¶ 参数名称应该是一个字符串,这个函数从obj给定的对象中删除命名属性。
-
class
dict¶
-
dir()¶
-
divmod()¶
-
enumerate()¶
-
eval()¶
-
exec()¶
-
filter()¶
-
class
float¶
-
class
frozenset¶
frozenset()在非 Express CircuitPython 板上未启用。
-
getattr()¶
-
globals()¶
-
hasattr()¶
-
hash()¶
-
hex()¶
-
id()¶
-
input()¶
-
class
int¶ -
classmethod
from_bytes(bytes, byteorder)¶ 在 CircuitPython 中,
byteorder参数必须是位置性的(这与 CPython 兼容)。
-
to_bytes(size, byteorder)¶ 在 CircuitPython 中,
byteorder参数必须是位置性的(这与 CPython 兼容)。
-
classmethod
-
isinstance()¶
-
issubclass()¶
-
iter()¶
-
len()¶
-
class
list¶
-
locals()¶
-
map()¶
-
max()¶
-
class
memoryview¶
-
min()¶
-
next()¶
-
class
object¶
-
oct()¶
-
open()¶
-
ord()¶
-
pow()¶
-
print()¶
-
property()¶
-
range()¶
-
repr()¶
-
reversed()¶
reversed()在非 Express CircuitPython 板上未启用。
-
round()¶
-
class
set¶
-
setattr()¶
-
class
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¶
-
exception
RuntimeError¶
-
exception
ReloadException¶ ReloadException用于内部处理软重启。
-
exception
StopIteration¶
-
exception
SyntaxError¶
-
exception
SystemExit¶ 请参阅 CPython 文档:
SystemExit.
-
exception
ValueError¶
-
exception
ZeroDivisionError¶