MetaBehaviorHaver
- class PlasmaCalcs.dimensions.behavior.MetaBehaviorHaver(*args, **kw)
Bases:
typemetaclass for BehaviorHaver. adds cls_behavior_attrs to the class namespace;
use cls_behavior_attrs.register(new_attr) to register a new attr as a behavior attr.Note that __prepare__ gets called before class definition begins, and fills class namespace,then __init__ gets called after class definition ends. For example:class MySubclass(metaclass=MetaBehaviorHaver):# <– __prepare__ runs here. Roughly: locals().update(__prepare__())pass # or, define other functions, variables, etc, as desired.# <– __init__ runs here. Roughly: MetaBehaviorHaver.__init__(MySubclass)Methods
__init__(*args, **kw)initialize cls (with metaclass=MetaBehaviorHaver)
__prepare__(_name, bases, **kw_super)return a dict with register_behavior_attr in it.
mro()Return a type's method resolution order.
- __init__(*args, **kw)
initialize cls (with metaclass=MetaBehaviorHaver)
- classmethod __prepare__(_name, bases, **kw_super)
return a dict with register_behavior_attr in it.
- mro()
Return a type’s method resolution order.