PlasmaCalcs.tools.iterables.Bijection
- class PlasmaCalcs.tools.iterables.Bijection(*args, **kw)
Bases:
dictstores forward and backward mapping.behaves like forward mapping, but self.inverse is the reverse mapping.- __init__(*args, **kw)
Methods
__init__(*args, **kw)clear()copy()fromkeys([value])get(key[, default])items()keys()pop(key[, default])popitem()setdefault(key[, default])update(*args, **kw)values()Attributes
- clear()
- clear all items from this bijection.
- copy() a shallow copy of D
- fromkeys(value=None, /)
- Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)
- Return the value for key if key is in the dictionary, else default.
- property inverse
- reverse mapping. {value: key} for all items in this bijection.
- items() a set-like object providing a view on D's items
- keys() a set-like object providing a view on D's keys
- pop(key, default=UNSET)
- pop the value for this key, and return it.
- popitem()
- pop an item from this bijection, and return it.
- setdefault(key, default=None, /)
- Insert key with a value of default if key is not in the dictionary.Return the value for key if key is in the dictionary, else default.
- update(*args, **kw)
- update this bijection with new items.
- values() an object providing a view on D's values