class IContext(Interface): (source)
Known subclasses: codetools.contexts.i_adapted_data_context.IAdaptedDataContext
, codetools.contexts.i_context.IListenableContext
, codetools.contexts.i_context.IPersistableContext
, codetools.contexts.i_context.IRestrictedContext
A context which can be used for executing code in. The __*item__ methods are the minimal methods necessary for execution. They, plus keys(), form the minimal set of methods that need to be implemented for UserDict.DictMixin to provide the rest of the dictionary interface. __contains__ is added to the interface because it is too useful to omit. Note that __setitem__ can raise a ValueError.
Method | __contains__ |
Test whether the key is available in the context or not. |
Method | __delitem__ |
Remove the given key with [] access. |
Method | __getitem__ |
Get item with [] access. |
Method | __setitem__ |
Set item with [] access. |
Method | keys |
Returns the list of keys available in the context. |
Test whether the key is available in the context or not. Parameters ---------- key : str Returns ------- contains : bool
Remove the given key with [] access. Parameters ---------- key : str Raises ------ KeyError if the kew is not available in the context.
Get item with [] access. Parameters ---------- key : str Returns ------- obj : object Raises ------ KeyError if the key is not available in the context.
Set item with [] access. Parameters ---------- key : str value : object Raises ------ ValueError if the key is not permitted to be assigned that value.