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, **kwargs)[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
__contains__(key)
Return type

Any

__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({'__init__', 'copy'}), '_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__': -9223366115461267705})
__eq__(other)

Return self==value.

__extra__ = None
__getitem__(key)
Return type

Any

__hash__ = None
abstract __init__(*args, **kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

__iter__()
__len__()
Return type

int

__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)
__repr__()

Return repr(self).

Return type

str

__reversed__ = None
__slots__ = ()
__subclasshook__()
__tree_hash__ = -9223366115461267705
__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