structa.collections
- class structa.collections.FrozenCounter(it)[source]
An immutable variant of the
collections.Counterclass from the Python standard library.This implements all readable properties and behaviours of the
collections.Counterclass, but excludes all methods and behaviours which permit modification of the counter. The resulting instances are hashable and can be used as keys in mappings.- classmethod from_counter(counter)[source]
Construct a
FrozenCounterfrom acollections.Counterinstance. This is generally much faster than attempting to construct from the elements of an existing counter.The counter parameter must either be a
collections.Counterinstance, or aFrozenCounterinstance (in which case it is returned verbatim).