字典对象

type PyDictObject

此子类型的 PyObject represents a Python dictionary object.

PyTypeObject PyDict_Type
属于 稳定 ABI (应用程序二进制接口) .

此实例的 PyTypeObject represents the Python dictionary type. This is the same object as dict 在 Python 层。

int PyDict_Check ( PyObject * p )

返回 True 若 p is a dict object or an instance of a subtype of the dict type. This function always succeeds.

int PyDict_CheckExact ( PyObject * p )

返回 True 若 p is a dict object, but not an instance of a subtype of the dict type. This function always succeeds.

PyObject * PyDict_New ( )
返回值:新引用。 属于 稳定 ABI (应用程序二进制接口) .

Return a new empty dictionary, or NULL 当故障时。

PyObject * PyDictProxy_New ( PyObject * 映射 )
返回值:新引用。 属于 稳定 ABI (应用程序二进制接口) .

返回 types.MappingProxyType object for a mapping which enforces read-only behavior. This is normally used to create a view to prevent modification of the dictionary for non-dynamic class types.

void PyDict_Clear ( PyObject * p )
属于 稳定 ABI (应用程序二进制接口) .

Empty an existing dictionary of all key-value pairs.

int PyDict_Contains ( PyObject * p , PyObject * key )
属于 稳定 ABI (应用程序二进制接口) .

Determine if dictionary p 包含 key . If an item in p is matches key ,返回 1 ,否则返回 0 . On error, return -1 . This is equivalent to the Python expression key in p .

int PyDict_ContainsString ( PyObject * p , const char * key )

这如同 PyDict_Contains() ,但 key is specified as a const char * UTF-8 encoded bytes string, rather than a PyObject * .

3.13 版添加。