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.Methods
clear()clear all items from this bijection.
copy()fromkeys([value])Create a new dictionary with keys from iterable and values set to value.
get(key[, default])Return the value for key if key is in the dictionary, else default.
items()keys()pop(key[, default])pop the value for this key, and return it.
popitem()pop an item from this bijection, and return it.
setdefault(key[, default])Insert key with a value of default if key is not in the dictionary.
update(*args, **kw)update this bijection with new items.
values()Attributes
reverse mapping.
- 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