[Python-checkins] python/dist/src/Doc/tut tut.tex,1.168,1.169

fdrake@users.sourceforge.net fdrake@users.sourceforge.net
2002年8月14日 08:26:20 -0700


Update of /cvsroot/python/python/dist/src/Doc/tut
In directory usw-pr-cvs1:/tmp/cvs-serv16813
Modified Files:
	tut.tex 
Log Message:
Remove a broken example of extreme backward compatibility; it is
simply not relevant any more.
Closes SF bug #595032.
Index: tut.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v
retrieving revision 1.168
retrieving revision 1.169
diff -C2 -d -r1.168 -r1.169
*** tut.tex	7 Aug 2002 20:20:52 -0000	1.168
--- tut.tex	14 Aug 2002 15:26:18 -0000	1.169
***************
*** 4019,4043 ****
 when referencing \code{__dict__} directly.
 
- Here's an example of a class that implements its own
- \method{__getattr__()} and \method{__setattr__()} methods and stores
- all attributes in a private variable, in a way that works in all
- versions of Python, including those available before this feature was
- added:
- 
- \begin{verbatim}
- class VirtualAttributes:
- __vdict = None
- __vdict_name = locals().keys()[0]
- 
- def __init__(self):
- self.__dict__[self.__vdict_name] = {}
- 
- def __getattr__(self, name):
- return self.__vdict[name]
- 
- def __setattr__(self, name, value):
- self.__vdict[name] = value
- \end{verbatim}
- 
 
 \section{Odds and Ends \label{odds}}
--- 4019,4022 ----

AltStyle によって変換されたページ (->オリジナル) /