PySetObject

This data structure is shared by set and frozenset objects.

Invariants for frozensets: data is immutable. hash is the hash of the frozenset or -1 if not computed yet. Invariants for sets: hash is -1

subclass of PyObject.

Members

Mixins

__anonymous
mixin PyObject_HEAD
Undocumented in source.

Variables

fill
Py_ssize_t fill;

Availability: >= 2.5

finger
Py_ssize_t finger;

_

hash
Py_hash_t hash;

_

mask
Py_ssize_t mask;

The table contains mask + 1 slots, and that's a power of 2. We store the mask instead of the size because the mask is more frequently needed.

smalltable
setentry[PySet_MINSIZE] smalltable;

_

table
setentry* table;

table points to smalltable for small tables, else to additional malloc'ed memory. table is never NULL! This rule saves repeated runtime null-tests.

used
Py_ssize_t used;

Availability: >= 2.5

weakreflist
PyObject* weakreflist;

_

Mixed In Members

From mixin PyObject_HEAD

__anonymous
mixin _PyObject_HEAD_EXTRA
Undocumented in source.
ob_refcnt
Py_ssize_t ob_refcnt;

_

ob_type
PyTypeObject* ob_type;

_

Meta