lisa.utils.FrozenDict#

class lisa.utils.FrozenDict(x, deepcopy=True, type_=<class 'dict'>)[source]#

Bases: Mapping

Read-only mapping that is therefore hashable.

Parameters:
  • deepcopy (bool) – If True, a deepcopy of the input will be done after applying type_.

  • type (collections.abc.Callable) – Called on the input to provide a suitable mapping, so that the input can be any iterable.

Note

The content of the iterable passed to the constructor is deepcopied to ensure non-mutability.

Note

Hashability allows to use it as a key in other mappings.

Attributes

__reversed__ inherited

See collections.abc.Mapping.__reversed__

Methods

__getitem__()

__iter__()

__len__()

__class_getitem__() inherited

See collections.abc.Iterable.__class_getitem__()

__contains__() inherited

See collections.abc.Mapping.__contains__()

get() inherited

See collections.abc.Mapping.get()

items() inherited

See collections.abc.Mapping.items()

keys() inherited

See collections.abc.Mapping.keys()

values() inherited

See collections.abc.Mapping.values()

Attributes#

FrozenDict.__reversed__ = None#

Methods#

FrozenDict.__getitem__(key)[source]#
FrozenDict.__iter__()[source]#
FrozenDict.__len__()[source]#
classmethod FrozenDict.__class_getitem__()#

Inherited method, see collections.abc.Iterable.__class_getitem__()

FrozenDict.__contains__()#

Inherited method, see collections.abc.Mapping.__contains__()

FrozenDict.get()#

Inherited method, see collections.abc.Mapping.get()

FrozenDict.items()#

Inherited method, see collections.abc.Mapping.items()

FrozenDict.keys()#

Inherited method, see collections.abc.Mapping.keys()

FrozenDict.values()#

Inherited method, see collections.abc.Mapping.values()