PlasmaCalcs.tools.iterables.SymmetricPairMapping
- class PlasmaCalcs.tools.iterables.SymmetricPairMapping(mapping={})
Bases:
objectmapping with keys pairs, where order of the pair doesn’t matter.mapping: dict of {(obj1, obj2): value}
The keys (obj2, obj1) and (obj1, obj2) will be treated the same way,when getting/setting/deleting items, and when checking if key in self.[EFF] For efficiency, only stores one of these pairs (the one where obj1 <= obj2).- __init__(mapping={})
Methods
__init__([mapping])clear()copy()items()keys()pop(key, default)update(other)values()- clear()
- remove all known items from self.
- copy()
- return a shallow copy of self.
- pop(key, default)
- remove self[key], and return its value. if key not in self, return default.
- update(other)
- update self with other.
other: dict of {(obj1, obj2): value}