Skip to main content

OrderedDict

Standard library class internal.types.collections.dict.OrderedDict View source
class OrderedDict
class OrderedDict[K, V]
Fields 2
K type
V type
Constructors 5
__init__
__init__(self: Self, /, capacity: int = 8)
__init__
__init__(self: Self, items: Generator[Tuple[(K, V)]], /)
__init__
__init__(self: Self, other: OrderedDict[(K, V)], /)
__init__
__init__(self: Dict[(K, int)], other: Counter[K])
Added by collections
__init__
__init__[S: type](self: Dict[(K, V)], other: defaultdict[(K, V, S)])
Added by collections
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, /)
update(self: Dict[(K, int)], other: Counter[K])
Added by collections
update[S: type](self: Dict[(K, V)], other: defaultdict[(K, V, S)])
Added by collections
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 24
__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
__eq__(self: Dict[(K, int)], other: Counter[K])
Added by collections
__eq__[S: type](self: Dict[(K, V)], other: defaultdict[(K, V, S)])
Added by collections
__ne__
__ne__(self: Self, other: OrderedDict[(K, V)], /) -> bool
__ne__(self: Dict[(K, int)], other: Counter[K])
Added by collections
__ne__[S: type](self: Dict[(K, V)], other: defaultdict[(K, V, S)])
Added by collections
__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)
__to_gpu__
__to_gpu__(self: Self, cache: AllocCache)
Added by internal.gpu
__from_gpu__
__from_gpu__(self: Self, other: Dict[(K, V)])
Added by internal.gpu
__from_gpu_new__
__from_gpu_new__(other: Dict[(K, V)])
Added by internal.gpu
__pickle__
__pickle__(self: Self, jar: Jar)
Added by pickle
__unpickle__
__unpickle__(jar: Jar) -> Dict[(K, V)]
Added by pickle
__to_py__
__to_py__(self: Self) -> cobj
__from_py__
__from_py__(d: cobj) -> Dict[(K, V)]