[Python-checkins] python/dist/src/Doc/lib asttable.tex, 1.1, 1.2 libfuncs.tex, 1.167, 1.168

anthonybaxter at users.sourceforge.net anthonybaxter at users.sourceforge.net
Mon Aug 2 08:10:25 CEST 2004


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6086/Doc/lib
Modified Files:
	asttable.tex libfuncs.tex 
Log Message:
PEP-0318, @decorator-style. In Guido's words:
"@ seems the syntax that everybody can hate equally"
Implementation by Mark Russell, from SF #979728.
Index: asttable.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/asttable.tex,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** asttable.tex	27 Sep 2001 20:06:07 -0000	1.1
--- asttable.tex	2 Aug 2004 06:09:52 -0000	1.2
***************
*** 74,77 ****
--- 74,80 ----
 \hline 
 
+ \lineiii{Decorators}{\member{nodes}}{List of function decorator expressions}
+ \hline 
+ 
 \lineiii{Dict}{\member{items}}{}
 \hline 
***************
*** 102,106 ****
 \hline 
 
! \lineiii{Function}{\member{name}}{name used in def, a string}
 \lineiii{}{\member{argnames}}{list of argument names, as strings}
 \lineiii{}{\member{defaults}}{list of default values}
--- 105,110 ----
 \hline 
 
! \lineiii{Function}{\member{decorators}}{\class{Decorators} or \code{None}}
! \lineiii{}{\member{name}}{name used in def, a string}
 \lineiii{}{\member{argnames}}{list of argument names, as strings}
 \lineiii{}{\member{defaults}}{list of default values}
Index: libfuncs.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libfuncs.tex,v
retrieving revision 1.167
retrieving revision 1.168
diff -C2 -d -r1.167 -r1.168
*** libfuncs.tex	29 Jul 2004 06:06:34 -0000	1.167
--- libfuncs.tex	2 Aug 2004 06:09:52 -0000	1.168
***************
*** 110,117 ****
 \begin{verbatim}
 class C:
 def f(cls, arg1, arg2, ...): ...
- f = classmethod(f)
 \end{verbatim}
 
 It can be called either on the class (such as \code{C.f()}) or on an
 instance (such as \code{C().f()}). The instance is ignored except for
--- 110,121 ----
 \begin{verbatim}
 class C:
+ @classmethod
 def f(cls, arg1, arg2, ...): ...
 \end{verbatim}
 
+ The \code{@classmethod} form is a function decorator -- see the description
+ of function definitions in chapter 7 of the
+ \citetitle[../ref/ref.html]{Python Reference Manual} for details.
+ 
 It can be called either on the class (such as \code{C.f()}) or on an
 instance (such as \code{C().f()}). The instance is ignored except for
***************
*** 123,126 ****
--- 127,131 ----
 If you want those, see \function{staticmethod()} in this section.
 \versionadded{2.2}
+ Function decorator syntax added in version 2.4.
 \end{funcdesc}
 
***************
*** 937,944 ****
 \begin{verbatim}
 class C:
 def f(arg1, arg2, ...): ...
- f = staticmethod(f)
 \end{verbatim}
 
 It can be called either on the class (such as \code{C.f()}) or on an
 instance (such as \code{C().f()}). The instance is ignored except
--- 942,953 ----
 \begin{verbatim}
 class C:
+ @staticmethod
 def f(arg1, arg2, ...): ...
 \end{verbatim}
 
+ The \code{@staticmethod} form is a function decorator -- see the description
+ of function definitions in chapter 7 of the
+ \citetitle[../ref/ref.html]{Python Reference Manual} for details.
+ 
 It can be called either on the class (such as \code{C.f()}) or on an
 instance (such as \code{C().f()}). The instance is ignored except


More information about the Python-checkins mailing list

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