entity_query_language.hashed_data#

Attributes#

T

Classes#

HashedValue

Value wrapper carrying a stable hash identifier.

HashedIterable

A wrapper for an iterable that hashes its items.

Module Contents#

entity_query_language.hashed_data.T#
class entity_query_language.hashed_data.HashedValue#

Bases: Generic[T]

Value wrapper carrying a stable hash identifier.

Parameters:
  • value – The wrapped value.

  • id – Optional explicit identifier; if omitted, derived from value.

Variables:
  • value – The wrapped value.

  • id – The stable identifier used for hashing and equality.

value: T#
id_: int | None = None#
class entity_query_language.hashed_data.HashedIterable#

Bases: Generic[T]

A wrapper for an iterable that hashes its items. This is useful for ensuring that the items in the iterable are unique and can be used as keys in a dictionary.

iterable: Iterable[HashedValue[T]] = []#
values: Dict[int, HashedValue[T]]#
set_iterable(iterable)#
get(key: int, default: Any) HashedValue[T]#
add(value: Any)#
update(iterable: Iterable[Any])#
map(func: Callable[[HashedValue], HashedValue], ids: List[int] | None = None) HashedIterable[T]#
filter(func: Callable[[HashedValue], bool]) HashedIterable[T]#
property unwrapped_values: List[T]#
property first_value: HashedValue#

Return the first value in the iterable.

clear()#
intersection(other)#
difference(other)#
union(other)#