| Home | Trees | Indices | Help |
|---|
|
|
object --+
|
BooleanContext
This class represents an boolean variable with RAII setting within a scope. It is useful to break recursions in an exception-safe way. The boolean context can be used in nested fashion, as long as you request a new context manager for every 'with' statement using the call operator. Example:
in_notification = BooleanContext()
assert not in_notification
with in_notification():
assert in_notification
with in_notification():
assert in_notification
assert in_notification
assert not in_notification
The 'default_value' parameter indicates the initial value. It will be negated when you enter the context.
|
|||
| Manager | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from |
|||
|
|||
default_value = False
|
|||
|
|||
| value | |||
|
Inherited from |
|||
|
|||
x.__init__(...) initializes x; see help(type(x)) for signature
|
|
|||
value
|
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Wed Mar 6 18:53:32 2013 | http://epydoc.sourceforge.net |