defaultdict

Standard library class collections.defaultdict View source
class defaultdict
@tuple
class defaultdict[K, V, S]
Fields 4
default_factory S
K type
V type
S TypeTrait[CallableTrait[V]]
Constructors 8
__new__
__new__(VV: TypeTrait[V])
Defined in collections
__new__
__new__(f: S)
Defined in collections
__new__
__new__(VV: TypeTrait[V], other: OrderedDict[K, V])
Defined in collections
__new__
__new__(f: S, other: OrderedDict[K, V])
Defined in collections
__new__
__new__(VV: TypeTrait[V], other: defaultdict[K, V, F], F: type)
Defined in collections
__new__
__new__(f: S, other: defaultdict[K, V, F], F: type)
Defined in collections
__new__
__new__(VV: TypeTrait[V], other: Counter[K])
Defined in collections
__new__
__new__(f: S, other: Counter[K])
Defined in collections
Methods 13
keys
keys(self)
Defined in collections
values
values(self)
Defined in collections
items
items(self)
Defined in collections
get
get(self, key: K)
Defined in collections
get(self, key: K, default: V)
Defined in collections
setdefault
setdefault(self, key: K, value: V)
Defined in collections
pop
pop(self, key: K)
Defined in collections
pop(self, key: K, missing)
Defined in collections
popitem
popitem(self)
Defined in collections
clear
clear(self)
Defined in collections
resize
resize(self, minused: int)
Defined in collections
increment
increment(self, key: K, by: Z = 1, Z: type)
Defined in collections
update
update(self, other)
Defined in collections
fromkeys
fromkeys(ks: Generator[K], v: V, K: type, V: type)
Defined in collections
copy
copy(self)
Defined in collections
Special methods 18
__len__
__len__(self)
Defined in collections
__bool__
__bool__(self)
Defined in collections
__iter__
__iter__(self)
Defined in collections
__reversed__
__reversed__(self)
Defined in collections
__contains__
__contains__(self, key: K)
Defined in collections
__setitem__
__setitem__(self, key: K, value: V)
Defined in collections
__delitem__
__delitem__(self, key: K)
Defined in collections
__or__
__or__(self, other)
Defined in collections
__ior__
__ior__(self, other)
Defined in collections
__missing__
__missing__(self, key: K)
Defined in collections
__getitem__
__getitem__(self, key: K)
Defined in collections
__dict_do_op_throws__
__dict_do_op_throws__(self, key: K, other: Z, op: F, F: type, Z: type)
Defined in collections
__dict_do_op__
__dict_do_op__(self, key: K, other: Z, default: V, op: F, F: type, Z: type)
Defined in collections
__copy__
__copy__(self)
Defined in collections
__deepcopy__
__deepcopy__(self)
Defined in collections
__eq__
__eq__(self, other: defaultdict[K, V, F], F: type)
Defined in collections
__eq__(self, other: OrderedDict[K, V])
Defined in collections
__eq__(self, other: Counter[K])
Defined in collections
__ne__
__ne__(self, other: defaultdict[K, V, F], F: type)
Defined in collections
__ne__(self, other: OrderedDict[K, V])
Defined in collections
__ne__(self, other: Counter[K])
Defined in collections
__repr__
__repr__(self)
Defined in collections