class documentation

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.
def __contains__(self, key): (source)

Test whether the key is available in the context or not. Parameters ---------- key : str Returns ------- contains : bool

def __delitem__(self, key): (source)

Remove the given key with [] access. Parameters ---------- key : str Raises ------ KeyError if the kew is not available in the context.

def __getitem__(self, key): (source)

Get item with [] access. Parameters ---------- key : str Returns ------- obj : object Raises ------ KeyError if the key is not available in the context.

def __setitem__(self, key, value): (source)

Set item with [] access. Parameters ---------- key : str value : object Raises ------ ValueError if the key is not permitted to be assigned that value.

def keys(self): (source)

Returns the list of keys available in the context. Returns ------- keys : list of str