mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Use methoddesc and memberdesc, as needed.
Added description of BastionClass, since it is referred to in the Bastion description as subclassable.
This commit is contained in:
parent
182bd2d176
commit
da70ee1fae
4 changed files with 104 additions and 84 deletions
|
|
@ -1,7 +1,6 @@
|
|||
\section{Standard Module \sectcode{Bastion}}
|
||||
\label{module-Bastion}
|
||||
\stmodindex{Bastion}
|
||||
\setindexsubitem{(in module Bastion)}
|
||||
|
||||
% I'm concerned that the word 'bastion' won't be understood by people
|
||||
% for whom English is a second language, making the module name
|
||||
|
|
@ -17,7 +16,8 @@ other, unsafe attributes.
|
|||
|
||||
% I've punted on the issue of documenting keyword arguments for now.
|
||||
|
||||
\begin{funcdesc}{Bastion}{object\optional{, filter, name, class}}
|
||||
\begin{funcdesc}{Bastion}{object\optional{, filter\optional{,
|
||||
name\optional{, class}}}}
|
||||
Protect the object \var{object}, returning a bastion for the
|
||||
object. Any attempt to access one of the object's attributes will
|
||||
have to be approved by the \var{filter} function; if the access is
|
||||
|
|
@ -32,8 +32,17 @@ will be \samp{<Bastion for \var{name}>} if a value for
|
|||
\var{name} is provided; otherwise, \samp{repr(\var{object})} will be
|
||||
used.
|
||||
|
||||
\var{class}, if present, would be a subclass of \class{BastionClass};
|
||||
\var{class}, if present, should be a subclass of \class{BastionClass};
|
||||
see the code in \file{bastion.py} for the details. Overriding the
|
||||
default \class{BastionClass} will rarely be required.
|
||||
|
||||
\end{funcdesc}
|
||||
|
||||
|
||||
\begin{classdesc}{BastionClass}{getfunc, name}
|
||||
Class which actually implements bastion objects. This is the default
|
||||
class used by \function{Bastion()}. The \var{getfunc} parameter is a
|
||||
function which returns the value of an attribute which should be
|
||||
exposed to the restricted execution environment when called with the
|
||||
name of the attribute as the only parameter. \var{name} is used to
|
||||
construct the \function{repr()} of the \class{BastionClass} instance.
|
||||
\end{classdesc}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue