pymap.frozen

Frozen collection types not (yet) provided by the Python library.

class pymap.frozen.HashableT

The type variable representing a mapping key.

alias of TypeVar(‘HashableT’, bound=Hashable)

class pymap.frozen.ValueT

The type variable representing a value in a collection.

alias of TypeVar(‘ValueT’)

final class pymap.frozen.FrozenDict(mapping={})[source]

A Mapping that does not support mutation.

Parameters:

mapping (Mapping[HashableT, ValueT] | Iterable[tuple[HashableT, ValueT]]) – Initiailize with the contents of another mapping.

keys() a set-like object providing a view on D's keys[source]
Return type:

Any

values() an object providing a view on D's values[source]
Return type:

Any

items() a set-like object providing a view on D's items[source]
Return type:

Any

get(k[, d]) D[k] if k in D, else d.  d defaults to None.[source]
Parameters:
Return type:

Any

final class pymap.frozen.FrozenList(iterable=[])[source]

A Sequence that does not support mutation.

Parameters:

iterable (Iterable[ValueT]) – Initiailize with the contents of another iterable.

index(value[, start[, stop]]) integer -- return first index of value.[source]

Raises ValueError if the value is not present.

Supporting start and stop arguments is optional, but recommended.

Parameters:
Return type:

Any

count(value) integer -- return number of occurrences of value[source]
Parameters:

value (Any)

Return type:

Any

pymap.frozen.frozendict

An alias for FrozenDict.

pymap.frozen.frozenlist

An alias for FrozenList.