Python 中的 boolean 是以整數子類別化來實現的。只有 Py_False
和 Py_True
兩個 boolean。因此一般的建立和刪除函式並不適用於 boolean。但下列巨集 (macro) 是可用的。
This instance of PyTypeObject
represents the Python boolean type; it
is the same object as bool
in the Python layer.
如果 o 的型別為 PyBool_Type
則回傳真值。此函式總是會成功執行。
Python 的 False
物件。此物件沒有任何方法且為不滅的 (immortal)。