Skip to main content

PyHashTableEntry

This class represents a single entry within a hash table, storing a Python object key alongside its precomputed 64-bit hash value and an associated generic value. By caching the hash value, it ensures consistency during table operations and protects against potential recomputation failures caused by the dynamic nature of Python objects.

Attributes

AttributeTypeDescription
keyPy< PyAny >The Python object used as the unique identifier for this entry in the hash table.
hashu64Precomputed hash value (from Python hash) - this avoids possibility of Python dynamic nature causing rehashing to fail
valueTThe generic data payload associated with the specific key in the entry.

Constructor

Signature

def PyHashTableEntry(
key: Py< PyAny >,
hash: u64,
value: T
)

Parameters

NameTypeDescription
keyPy< PyAny >The Python object key for the entry.
hashu64The precomputed hash value of the key.
valueTThe generic value associated with the key.

Signature

def PyHashTableEntry(
key: Py< PyAny >,
hash: u64,
value: T
) - > [PyHashTableEntry](pyhashtableentry.md?sid=tools_pyhashtableentry)

Parameters

NameTypeDescription
keyPy< PyAny >The Python object used as the lookup key for this entry.
hashu64The precomputed Python hash value used to ensure consistent lookups and avoid re-hashing during table operations.
valueTThe generic data value associated with the specified key.