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
| Attribute | Type | Description |
|---|---|---|
| key | Py< PyAny > | The Python object used as the unique identifier for this entry in the hash table. |
| hash | u64 | Precomputed hash value (from Python hash) - this avoids possibility of Python dynamic nature causing rehashing to fail |
| value | T | The generic data payload associated with the specific key in the entry. |
Constructor
Signature
def PyHashTableEntry(
key: Py< PyAny >,
hash: u64,
value: T
)
Parameters
| Name | Type | Description |
|---|---|---|
| key | Py< PyAny > | The Python object key for the entry. |
| hash | u64 | The precomputed hash value of the key. |
| value | T | The generic value associated with the key. |
Signature
def PyHashTableEntry(
key: Py< PyAny >,
hash: u64,
value: T
) - > [PyHashTableEntry](pyhashtableentry.md?sid=tools_pyhashtableentry)
Parameters
| Name | Type | Description |
|---|---|---|
| key | Py< PyAny > | The Python object used as the lookup key for this entry. |
| hash | u64 | The precomputed Python hash value used to ensure consistent lookups and avoid re-hashing during table operations. |
| value | T | The generic data value associated with the specified key. |