deimos.python.dictobject

Mirror dictobject.h

Members

Functions

PyDictItems_Check
int PyDictItems_Check(PyObject* op)

Availability: >= 2.7

PyDictKeys_Check
int PyDictKeys_Check(PyObject* op)

Availability: >= 2.7

PyDictValues_Check
int PyDictValues_Check(PyObject* op)

Availability: >= 2.7

PyDictViewSet_Check
int PyDictViewSet_Check(PyObject* op)

Availability: >= 2.7

PyDict_Check
int PyDict_Check(PyObject* op)

_

PyDict_CheckExact
int PyDict_CheckExact(PyObject* op)

_

PyDict_Clear
void PyDict_Clear(PyObject* mp)

_

PyDict_Contains
int PyDict_Contains(PyObject* mp, PyObject* key)

_

PyDict_Copy
PyObject* PyDict_Copy(PyObject* mp)

_

PyDict_DelItem
int PyDict_DelItem(PyObject* mp, PyObject* key)

_

PyDict_DelItemString
int PyDict_DelItemString(PyObject* dp, const(char)* key)

_

PyDict_GetItem
PyObject_BorrowedRef* PyDict_GetItem(PyObject* mp, PyObject* key)

_

PyDict_GetItemString
PyObject_BorrowedRef* PyDict_GetItemString(PyObject* dp, const(char)* key)

_

PyDict_GetItemWithError
Borrowed!PyObject* PyDict_GetItemWithError(PyObject* mp, PyObject* key)

Availability: 3.*

PyDict_Items
PyObject* PyDict_Items(PyObject* mp)

_

PyDict_Keys
PyObject* PyDict_Keys(PyObject* mp)

_

PyDict_Merge
int PyDict_Merge(PyObject* mp, PyObject* other, int override_)

PyDict_Merge updates/merges from a mapping object (an object that supports PyMapping_Keys() and PyObject_GetItem()). If override is true, the last occurrence of a key wins, else the first. The Python dict.update(other) is equivalent to PyDict_Merge(dict, other, 1).

PyDict_MergeFromSeq2
int PyDict_MergeFromSeq2(PyObject* d, PyObject* seq2, int override_)

PyDict_MergeFromSeq2 updates/merges from an iterable object producing iterable objects of length 2. If override is true, the last occurrence of a key wins, else the first. The Python dict constructor dict(seq2) is equivalent to dict={}; PyDict_MergeFromSeq(dict, seq2, 1).

PyDict_New
PyObject* PyDict_New()

_

PyDict_Next
int PyDict_Next(PyObject* mp, Py_ssize_t* pos, PyObject_BorrowedRef** key, PyObject_BorrowedRef** value)

_

PyDict_SetItem
int PyDict_SetItem(PyObject* mp, PyObject* key, PyObject* item)

_

PyDict_SetItemString
int PyDict_SetItemString(PyObject* dp, const(char)* key, PyObject* item)

_

PyDict_Size
Py_ssize_t PyDict_Size(PyObject* mp)

_

PyDict_Update
int PyDict_Update(PyObject* mp, PyObject* other)

PyDict_Update(mp, other) is equivalent to PyDict_Merge(mp, other, 1).

PyDict_Values
PyObject* PyDict_Values(PyObject* mp)

_

_PyDict_Contains
int _PyDict_Contains(PyObject* mp, PyObject* key, Py_hash_t* hash)

Availability: >= 2.5

_PyDict_DebugMallocStats
void _PyDict_DebugMallocStats(FILE* out_)

Availability: >= 2.7

_PyDict_HasOnlyStringKeys
int _PyDict_HasOnlyStringKeys(PyObject* mp)

Availability: 3.*

_PyDict_MaybeUntrack
void _PyDict_MaybeUntrack(PyObject* mp)

Availability: >= 2.7

_PyDict_NewPresized
PyObject* _PyDict_NewPresized(Py_ssize_t minused)

Availability: >= 2.6

_PyDict_Next
int _PyDict_Next(PyObject* mp, Py_ssize_t* pos, Borrowed!PyObject** key, Borrowed!PyObject** value, Py_hash_t* hash)

Availability: >= 2.5

Structs

PyDictEntry
struct PyDictEntry

_

PyDictObject
struct PyDictObject

To ensure the lookup algorithm terminates, there must be at least one Unused slot (NULL key) in the table. The value ma_fill is the number of non-NULL keys (sum of Active and Dummy); ma_used is the number of non-NULL, non-dummy keys (== the number of non-NULL values == the number of Active items). To avoid slowing down lookups on a near-full table, we resize the table when it's two-thirds full.

Variables

PyDict_MINSIZE
enum int PyDict_MINSIZE;

PyDict_MINSIZE is the minimum size of a dictionary. This many slots are allocated directly in the dict object (in the ma_smalltable member). It must be a power of 2, and at least 4. 8 allows dicts with no more than 5 active entries to live in ma_smalltable (and so avoid an additional malloc); instrumentation suggested this suffices for the majority of dicts (consisting mostly of usually-small instance dicts and usually-small dicts created to pass keyword arguments).

Meta