对象协议 ¶
-
PyObject
*
Py_GetConstant
(
unsigned
int
constant_id
)
¶
-
属于
稳定 ABI (应用程序二进制接口)
since version 3.13.
Get a 强引用 to a constant.
Set an exception and return
NULLif constant_id 无效。constant_id must be one of these constant identifiers:
Constant Identifier
值
Returned object
-
Py_CONSTANT_NONE
¶
0-
Py_CONSTANT_FALSE
¶
1-
Py_CONSTANT_TRUE
¶
2-
Py_CONSTANT_ELLIPSIS
¶
3-
Py_CONSTANT_NOT_IMPLEMENTED
¶
4-
Py_CONSTANT_ZERO
¶
50-
Py_CONSTANT_ONE
¶
61-
Py_CONSTANT_EMPTY_STR
¶
7''-
Py_CONSTANT_EMPTY_BYTES
¶
8b''-
Py_CONSTANT_EMPTY_TUPLE
¶
9()Numeric values are only given for projects which cannot use the constant identifiers.
3.13 版添加。
-
Py_CONSTANT_NONE
¶