Module shadow

The shadow module provides objects that act as
intermediaries for other objects, exposing selected attributes
of the original object and masking the rest. Like the Python
Bastion module, shadow provides a controlled
interface between trusted and untrusted code.

A close cousin of bastions, shadow objects offer a different
form of access to the object being reflected:

Shadow objects allow access to any kind of object attribute,
while bastions only allow access to methods from the
protected object; thus, shadows are useful for more than
just class instances. Their primary use in the KOE is to
provide selective dynamic reflection of the contents of
particular modules.

Shadow objects support reflection of changing attributes; in
bastions, each attribute is cached on the trusted side of
the interface.

Construct a shadow object for
original, coupling access to attributes listed in
the defers sequence so that get and set
operations of those attributes in the shadow are
mapped to the original object.

Getting values in the shadow for attributes
listed in defers gets the values from the
original, and changing values for those
attributes in the shadow applies the changes to
the attributes of original. Getting the
value of an attribute listed in defers which does
not exist on the original object causes an AttributeError
exception. Setting an attribute listed in defers
that does not already exist in the original causes it to be
created in the original.

Conversely, getting and setting attribute values for
attributes not on the defers list applies, in the
normal ways, only to the shadow object, not to the original.

No special methods are provided, but many disciplines for
attribute management are implemented to provide the required
functionality.