迭代器协议 ¶
There are two functions specifically for working with iterators.
-
int
PyIter_Check
(
PyObject
*
o
)
¶
-
属于
稳定 ABI (应用程序二进制接口)
since version 3.8.
Return non-zero if the object o can be safely passed to
PyIter_Next(),和0otherwise. This function always succeeds.
-
int
PyAIter_Check
(
PyObject
*
o
)
¶
-
属于
稳定 ABI (应用程序二进制接口)
since version 3.10.
Return non-zero if the object o 提供
AsyncIteratorprotocol, and0otherwise. This function always succeeds.3.10 版添加。