Skip to main content

internal.types.collections.dict

Standard library Module View source
class DictEntry
@tuple
class DictEntry[K, V]
Fields 5
key K
value V
hash int
K type
V type
Methods 1
with_value
with_value(self: Self, new_value: V)
Special methods 1
__deepcopy__
__deepcopy__(self: Self)
class OrderedDict
class OrderedDict[K, V]
Fields 2
K type
V type
Constructors 3
__init__
__init__(self: Self, /, capacity: int = 8)
__init__
__init__(self: Self, items: Generator[Tuple[(K, V)]], /)
__init__
__init__(self: Self, other: OrderedDict[(K, V)], /)
Methods 13
copy
copy(self: Self, /)
resize
resize(self: Self, minused: int)
get
get(self: Self, key: K, /) -> Optional[V]
get(self: Self, key: K, default: V, /)
setdefault
setdefault(self: Self, key: K, value: V, /) -> V
pop
pop(self: Self, key: K, /) -> V
pop(self: Self, key: K, missing, /)
popitem
popitem(self: Self, /)
keys
keys(self: Self, /)
values
values(self: Self, /)
items
items(self: Self, /)
update
update(self: Self, other, /)
clear
clear(self: Self, /)
fromkeys
fromkeys[K: type, V: type](ks: Generator[K], v: V, /) -> OrderedDict[(K, V)]
increment
increment[T: type](self: Self, key: K, by: T = 1)
Special methods 17
__copy__
__copy__(self: Self)
__deepcopy__
__deepcopy__(self: Self)
__len__
__len__(self: Self, /)
__bool__
__bool__(self: Self)
__setitem__
__setitem__(self: Self, key: K, value: V, /)
__getitem__
__getitem__(self: Self, key: K, /)
__contains__
__contains__(self: Self, key: K, /)
__delitem__
__delitem__(self: Self, key: K, /)
__reversed__
__reversed__(self: Self, /)
__iter__
__iter__(self: Self, /)
__eq__
__eq__(self: Self, other: OrderedDict[(K, V)], /) -> bool
__ne__
__ne__(self: Self, other: OrderedDict[(K, V)], /) -> bool
__or__
__or__(self: Self, other, /)
__ior__
__ior__(self: Self, other, /)
__repr__
__repr__(self: Self, /)
__dict_do_op_throws__
__dict_do_op_throws__[F: type, Z: type](self: Self, key: K, other: Z, op: F)
__dict_do_op__
__dict_do_op__[F: type, Z: type](self: Self, key: K, other: Z, dflt: V, op: F)
class UnorderedDict
class UnorderedDict[K, V]
Fields 2
K type
V type
Constructors 4
__init__
__init__(self: Self, /)
__init__
__init__(self: Self, /, capacity: int)
__init__
__init__(self: Self, g: Generator[Tuple[(K, V)]], /)
__init__
__init__(self: Self, other: UnorderedDict[(K, V)], /)
Methods 13
resize
resize(self: Self, new_n_buckets: int)
get
get(self: Self, key: K, default: V, /) -> V
get(self: Self, key: K, /) -> Optional[V]
setdefault
setdefault(self: Self, key: K, val: V, /) -> V
increment
increment[T: type](self: Self, key: K, by: T = 1)
update
update(self: Self, other, /)
update(self: Self, other: UnorderedDict[(K, V)], /)
pop
pop(self: Self, key: K, /) -> V
pop(self: Self, key: K, missing, /)
popitem
popitem(self: Self, /) -> Tuple[(K, V)]
clear
clear(self: Self, /)
items
items(self: Self, /) -> Generator[Tuple[(K, V)]]
keys
keys(self: Self, /) -> Generator[K]
values
values(self: Self, /) -> Generator[V]
copy
copy(self: Self, /)
fromkeys
fromkeys[K: type, V: type](ks: Generator[K], v: V, /) -> UnorderedDict[(K, V)]
Special methods 17
__getitem__
__getitem__(self: Self, key: K, /) -> V
__setitem__
__setitem__(self: Self, key: K, val: V, /)
__delitem__
__delitem__(self: Self, key: K, /)
__contains__
__contains__(self: Self, key: K, /) -> bool
__eq__
__eq__(self: Self, other: UnorderedDict[(K, V)], /) -> bool
__ne__
__ne__(self: Self, other: UnorderedDict[(K, V)], /) -> bool
__iter__
__iter__(self: Self, /) -> Generator[K]
__len__
__len__(self: Self, /) -> int
__or__
__or__(self: Self, other, /)
__ior__
__ior__(self: Self, other, /)
__copy__
__copy__(self: Self)
__deepcopy__
__deepcopy__(self: Self) -> UnorderedDict[(K, V)]
__repr__
__repr__(self: Self, /) -> str
__bool__
__bool__(self: Self)
__dict_do_op_throws__
__dict_do_op_throws__[F: type, Z: type](self: Self, key: K, other: Z, op: F)
__dict_do_op__
__dict_do_op__[F: type, Z: type](self: Self, key: K, other: Z, dflt: V, op: F)
__reversed__
__reversed__(self: Self, /)