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'})
__contains__(key)
__copy__(*args, **kwargs)
__dict__ = mappingproxy({'__module__': 'cawdrey.base', '__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>, '__abstractmethods__': frozenset({'__init__', 'copy'}), '_abc_registry': <_weakrefset.WeakSet object>, '_abc_cache': <_weakrefset.WeakSet object>, '_abc_negative_cache': <_weakrefset.WeakSet object>, '_abc_negative_cache_version': 42})
__eq__(other)

Return self==value.

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

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

__iter__()
__len__()
__module__ = 'cawdrey.base'
__repr__()

Return repr(self).

__reversed__ = None
__slots__ = ()
classmethod __subclasshook__(C)

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).

__weakref__

list of weak references to the object (if defined)

_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 42
_abc_registry = <_weakrefset.WeakSet object>
abstract copy(*args, **kwargs)
dict_cls = 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