Base Class¶
About¶
FrozenBase
is the base class for frozendict
and FrozenOrderedDict
. If you wish to
construct your own frozen dictionary classes, you may wish to inherit from
this class.
Usage¶
API Reference¶
-
class
cawdrey.base.
FrozenBase
(*args, **kwds)[source]¶ Abstract Base Class for Frozen dictionaries
Used by frozendict and FrozenOrderedDict.
Custom subclasses must implement at a minimum
__init__
,copy
,fromkeys
.-
__abstractmethods__
= frozenset({'__init__', 'copy'})¶
-
__annotations__
= {'dict_cls': typing.Union[typing.Type, NoneType]}¶
-
__args__
= None¶
-
__copy__
(*args, **kwargs)¶
-
__dict__
= mappingproxy({'__module__': 'cawdrey.base', '__annotations__': {'dict_cls': typing.Union[typing.Type, NoneType]}, '__doc__': '\n\tAbstract Base Class for Frozen dictionaries\n\n\tUsed by frozendict and FrozenOrderedDict.\n\n\tCustom subclasses must implement at a minimum ``__init__``,\n\t``copy``, ``fromkeys``.\n\t', 'dict_cls': None, '__init__': <function FrozenBase.__init__>, 'fromkeys': <classmethod object>, '__origin__': None, '__extra__': None, '_gorg': cawdrey.base.FrozenBase, '__abstractmethods__': frozenset({'copy', '__init__'}), '_abc_registry': <_weakrefset.WeakSet object>, '_abc_cache': <_weakrefset.WeakSet object>, '_abc_generic_negative_cache': <_weakrefset.WeakSet object>, '_abc_generic_negative_cache_version': 42, '__parameters__': (~KT, ~VT), '__args__': None, '__next_in_mro__': <class 'object'>, '__orig_bases__': (cawdrey.base.DictWrapper[~KT, ~VT],), '__subclasshook__': <function _make_subclasshook.<locals>.__extrahook__>, '__tree_hash__': -9223366138144189958})¶
-
__eq__
(other)¶ Return self==value.
-
__extra__
= None¶
-
__hash__
= None¶
-
abstract
__init__
(*args, **kwargs)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
__iter__
()¶
-
__module__
= 'cawdrey.base'¶
-
static
__new__
(cls, *args, **kwds)¶ Create and return a new object. See help(type) for accurate signature.
-
__next_in_mro__
¶ alias of
builtins.object
-
__orig_bases__
= (cawdrey.base.DictWrapper[~KT, ~VT],)¶
-
__origin__
= None¶
-
__parameters__
= (~KT, ~VT)¶
-
__reversed__
= None¶
-
__slots__
= ()¶
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__tree_hash__
= -9223366138144189958¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
_abc_cache
= <_weakrefset.WeakSet object>¶
-
_abc_generic_negative_cache
= <_weakrefset.WeakSet object>¶
-
_abc_generic_negative_cache_version
= 42¶
-
_abc_negative_cache
= <_weakrefset.WeakSet object>¶
-
_abc_negative_cache_version
= 42¶
-
_abc_registry
= <_weakrefset.WeakSet object>¶
-
_gorg
¶ alias of
FrozenBase
-
abstract
copy
(*args, **kwargs)¶
-
dict_cls
: Optional[Type] = None¶
-
classmethod
fromkeys
(*args, **kwargs)[source]¶ Returns a new dict with keys from iterable and values equal to value.
-
get
(k[, d]) → D[k] if k in D, else d. d defaults to None.¶
-
items
() → a set-like object providing a view on D’s items¶
-
keys
() → a set-like object providing a view on D’s keys¶
-
values
() → an object providing a view on D’s values¶
-