PlasmaCalcs.tools.sentinels.Sentinel

class PlasmaCalcs.tools.sentinels.Sentinel(name, repr=None, module_name=None, unique_includes_module=False)

Bases: object

Unique sentinel values. adapted from PEP 661.
name: str
str defining this sentinel. e.g. ‘UNSET’
repr: None or str
str defining repr for this sentinel. None –> use name.
module_name: None or str
name of module where this sentinel was defined. None –> infer it.
unique_includes_module: bool, default False
whether to include module name in “uniqueness” of this sentinel.
True –> calling Sentinel(name0) in module1 is a different object than Sentinel(name0) called in module2.
False –> Sentinel(name0) produces the same object regardless of where it was called from.
default False –> can access any sentinel value from any module, by providing its string.
e.g. Sentinel(‘UNSET’) is UNSET, always.
__init__()

Methods

__init__()