[Python-checkins] python/nondist/peps pep-0318.txt,1.15,1.16

montanaro at users.sourceforge.net montanaro at users.sourceforge.net
Fri Aug 6 05:53:23 CEST 2004


Update of /cvsroot/python/python/nondist/peps
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15035
Modified Files:
	pep-0318.txt 
Log Message:
some other minor updates
Index: pep-0318.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0318.txt,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** pep-0318.txt	6 Aug 2004 03:36:09 -0000	1.15
--- pep-0318.txt	6 Aug 2004 03:53:20 -0000	1.16
***************
*** 166,172 ****
 func = dec2(dec1(func))
 
! The decorators are near the declaration of the function's API but are
! clearly secondary. The @ sign makes it clear that something new is 
! going on here.
 
 The decorator statement is limited in what it can accept - arbitrary
--- 166,172 ----
 func = dec2(dec1(func))
 
! without the intermediate assignment to the variable ``func``. The
! decorators are near the function declaration. The @ sign makes it
! clear that something new is going on here.
 
 The decorator statement is limited in what it can accept - arbitrary
***************
*** 271,274 ****
--- 271,282 ----
 can be implemented in 2.3.
 
+ A `page on the Python Wiki`_ was created to summarize a number of the
+ proposals. Once it stabilizes perhaps someone would care to
+ incorporate its content into this PEP (hint, hint).
+ 
+ .. page on the Python Wiki:
+ http://www.python.org/moin/PythonDecorators
+ 
+ 
 Why @? 
 ------
***************
*** 341,345 ****
 return f
 
! def func() [onexit]:
 ...
 
--- 349,354 ----
 return f
 
! @onexit
! def func():
 ...
 
***************
*** 358,362 ****
 return getinstance
 
! class MyClass [singleton]:
 ...
 
--- 367,372 ----
 return getinstance
 
! @singleton
! class MyClass:
 ...
 
***************
*** 373,378 ****
 return decorate
 
! def mymethod(f) [attrs(versionadded="2.2", 
! author="Guido van Rossum")]:
 ...
 
--- 383,389 ----
 return decorate
 
! @attrs(versionadded="2.2",
! author="Guido van Rossum")
! def mymethod(f):
 ...
 
***************
*** 404,409 ****
 return check_returns
 
! def func(arg1, arg2) [accepts(int, (int,float)),
! returns((int,float))]:
 return arg1 * arg2
 
--- 415,421 ----
 return check_returns
 
! @accepts(int, (int,float))
! @returns((int,float))
! def func(arg1, arg2):
 return arg1 * arg2
 
***************
*** 430,437 ****
 """Declare something about IBar here"""
 
! class Foo(object) [provides(IBar)]:
 """Implement something here..."""
 
! Of course, all these examples are possible today, though without the
 syntactic support.
 
--- 442,450 ----
 """Declare something about IBar here"""
 
! @provides(IBar)
! class Foo(object):
 """Implement something here..."""
 
! Of course, all these examples are possible today, though without
 syntactic support.
 


More information about the Python-checkins mailing list

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