See also
,
and
.
intPyMapping_Check(
*o)
Part of the
.Return 1 if the object provides the mapping protocol or supports slicing, and 0 otherwise. Note that it returns 1 for Python classes with a
method, since in general it is impossible to determine what type of keys the class supports. This function always succeeds.
PyMapping_Size(
*o)
PyMapping_Length(
*o)
Part of the
.Returns the number of keys in object o on success, and -1 on failure. This is equivalent to the Python expression len(o).
*PyMapping_GetItemString(
*o, constchar*key)
Return value: New reference. Part of the
.This is the same as
, but key is specified as a constchar* UTF-8 encoded bytes string, rather than a
*.
intPyMapping_SetItemString(
*o, constchar*key,
*v)
Part of the
.This is the same as
, but key is specified as a constchar* UTF-8 encoded bytes string, rather than a
*.
intPyMapping_DelItem(
*o,
*key)
This is an alias of
.
intPyMapping_DelItemString(
*o, constchar*key)
This is the same as
, but key is specified as a constchar* UTF-8 encoded bytes string, rather than a
*.
intPyMapping_HasKey(
*o,
*key)
Part of the
.Return 1 if the mapping object has the key key and 0 otherwise. This is equivalent to the Python expression keyino. This function always succeeds.
intPyMapping_HasKeyString(
*o, constchar*key)
Part of the
.This is the same as
, but key is specified as a constchar* UTF-8 encoded bytes string, rather than a
*.
Note
Exceptions that occur when this calls
method or while creating the temporary
object are silently ignored. For proper error handling, use
instead.
*PyMapping_Keys(
*o)
Return value: New reference. Part of the
.On success, return a list of the keys in object o. On failure, return NULL.
Changed in version 3.7: Previously, the function returned a list or a tuple.
*PyMapping_Values(
*o)
Return value: New reference. Part of the
.On success, return a list of the values in object o. On failure, return NULL.
Changed in version 3.7: Previously, the function returned a list or a tuple.
*PyMapping_Items(
*o)
Return value: New reference. Part of the
.On success, return a list of the items in object o, where each item is a tuple containing a key-value pair. On failure, return NULL.
Changed in version 3.7: Previously, the function returned a list or a tuple.