Nektar++
|
Public Member Functions | |
def | __init__ (self, tf=False) |
def | __nonzero__ (self) |
def | set (self, tf=True) |
Private Attributes | |
_tf | |
A simple true/false store that can be used as a default parameter value in recursive calls. This provides a slightly nicer looking alternative to code such as: def f(done=[False]): if not done[0]: # do some stuff if xyz: done[0] = True f(done) The list can be replaced with a Sentinel instance.
Definition at line 142 of file utilities.py.
def CellMLToNektar.utilities.Sentinel.__init__ | ( | self, | |
tf = False |
|||
) |
Create a new, unset sentinel.
Definition at line 155 of file utilities.py.
def CellMLToNektar.utilities.Sentinel.__nonzero__ | ( | self | ) |
Test whether the sentinel has been set.
Definition at line 159 of file utilities.py.
References CellMLToNektar.utilities.Sentinel._tf.
def CellMLToNektar.utilities.Sentinel.set | ( | self, | |
tf = True |
|||
) |
Set the sentinel.
Definition at line 163 of file utilities.py.
References CellMLToNektar.utilities.Sentinel._tf.
|
private |
Definition at line 157 of file utilities.py.
Referenced by CellMLToNektar.utilities.Sentinel.__nonzero__(), and CellMLToNektar.utilities.Sentinel.set().