error_solver.solvers.Collector¶
-
class
error_solver.solvers.
Collector
[source]¶ A context manager for initiating value collection. When the context manager closes, the class dictionaries used for value collection will be set to empty values rather than being cleared. Therefore, if you have an active variable pointed to any of the dictionaries, those dictionaries will still be available outside of the context manager until your pointer falls out of scope.
Examples
Class method collection: .. literalinclude:: ../../examples/collector_ex1.py
Function collection: .. literalinclude:: ../../examples/collector_ex2.py
Methods
fget
(obj, \*default)Returns the value contained in the function dictionary. get_dict
()Returns the class dictionary. get_fdict
()Returns the function dictionary. set_dict
(obj, func, value)If collection is active, adds the value to the class dictionary. set_fdict
(func, value)If collection is active, adds the value to the function dictionary.