PyOpenWorm.contextualize module

class PyOpenWorm.contextualize.Contextualizable(*args, **kwargs)[source]

Bases: PyOpenWorm.contextualize.BaseContextualizable

A BaseContextualizable with the addition of a default behavior of setting the context from the class’s ‘context’ attribute. This generally requires that for the metaclass of the Contextualizable that a ‘context’ data property is defined. For example:

>>> class AMeta(ContextualizableClass):
>>>     @property
>>>     def context(self):
>>>         return self.__context
>>>     @context.setter
>>>     def context(self, ctx):
>>>         self.__context = ctx
>>> class A(six.with_metaclass(Contextualizable)):
>>>     pass
class PyOpenWorm.contextualize.ContextualizableClass[source]

Bases: type

A super-type for contextualizable classes

PyOpenWorm.contextualize.contextualize_helper(context, obj, noneok=False)[source]

Does some extra stuff to make access to the type of a ContextualizingProxy work more-or-less like access to the the wrapped object

PyOpenWorm.contextualize.decontextualize_helper(obj)[source]

Removes contexts from a ContextualizingProxy