| |
| According to the dictionary, a bastion is "a fortified area or position", or |
| "something that is considered a stronghold." It's a suitable name for this |
| module, which provides a way to forbid access to certain attributes of an |
| object. It must always be used with the :mod:`rexec` module, in order to allow |
| restricted-mode programs access to certain safe attributes of an object, while |
| denying access to other, unsafe attributes. |
| |
n | .. % I'm concerned that the word 'bastion' won't be understood by people |
n | .. I'm concerned that the word 'bastion' won't be understood by people |
| .. % for whom English is a second language, making the module name |
| .. for whom English is a second language, making the module name |
| .. % somewhat mysterious. Thus, the brief definition... --amk |
| .. somewhat mysterious. Thus, the brief definition... --amk |
| |
t | .. % I've punted on the issue of documenting keyword arguments for now. |
t | .. I've punted on the issue of documenting keyword arguments for now. |
| |
| |
| .. function:: Bastion(object[, filter[, name[, class]]]) |
| |
| Protect the object *object*, returning a bastion for the object. Any attempt to |
| access one of the object's attributes will have to be approved by the *filter* |
| function; if the access is denied an :exc:`AttributeError` exception will be |
| raised. |