constantdict#

class constantdict.constantdict[source]#

Bases: Dict[K, V]

An immutable dictionary.

classmethod fromkeys(*args: Any, **kwargs: Any) Any[source]#

Create a new constantdict from supplied keys and values.

__hash__() int[source]#

Return the hash of this constantdict.

__repr__() str[source]#

Return a string representation of this constantdict.

__reduce__() str | tuple[Any, ...][source]#

Return pickling information for this constantdict.

__or__(other: Any) constantdict[K, V][source]#

Return the union of this constantdict and other.

copy() dict[K, V][source]#

Return a shallow copy of this constantdict.

set(key: K, val: V) constantdict[K, V][source]#

Return a new constantdict with the item at key set to val.

delete(key: K) constantdict[K, V][source]#

Return a new constantdict without the item at the given key.

remove(key: K) constantdict[K, V][source]#

Return a new constantdict without the item at the given key.

update(other: Dict[K, V]) constantdict[K, V][source]#

Return a new constantdict with updated items from other.

discard(key: K) constantdict[K, V][source]#

Return a new constantdict without the item at the given key.

Return a reference to itself if the key is not present.

__delitem__(*args: Any, **kwargs: Any) None[source]#

Raise an AttributeError when trying to modify the object.

__ior__(*args: Any, **kwargs: Any) None[source]#

Raise an AttributeError when trying to modify the object.

__setitem__(*args: Any, **kwargs: Any) None[source]#

Raise an AttributeError when trying to modify the object.

clear(*args: Any, **kwargs: Any) None[source]#

Raise an AttributeError when trying to modify the object.

popitem(*args: Any, **kwargs: Any) None[source]#

Raise an AttributeError when trying to modify the object.

pop(*args: Any, **kwargs: Any) None[source]#

Raise an AttributeError when trying to modify the object.

setdefault(*args: Any, **kwargs: Any) None[source]#

Raise an AttributeError when trying to modify the object.

Internal stuff that is only here because the documentation tool wants it#

class constantdict.K#
class constantdict.V#