This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Implementation for PEP 318 ([as classmethod] version)
Type: Stage:
Components: Interpreter Core Versions: Python 2.4
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: mark_t_russell, nnorwitz
Priority: normal Keywords: patch

Created on 2004-04-08 23:37 by mark_t_russell, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
as-deco.diff mark_t_russell, 2004-04-08 23:37 PEP 318 [as xxx] patch
Messages (2)
msg45724 - (view) Author: Mark Russell (mark_t_russell) Date: 2004-04-08 23:37
This patch implements the alternative PEP 318 syntax
that I suggested on python-dev a few days ago:

       [as classmethod]
       def func(args):
       ...

List comprehensions are not allowed, nor are empty
lists.  The newline is optional (e.g. "[as xxx] def foo"
is handled).

Two substantive changes: a moderately nasty hack
to tokeniser.c to transform LSQB "as" NAME (with
optional interspersed whitespace and comments) into
LSQB_AS NAME, and a change to Grammar from:

     funcdef: 'def' NAME parameters ':' suite

to:

    decorators: LSQB_AS test (',' test)* [','] ']'
[NEWLINE]
    funcdef: [decorators] 'def' NAME parameters ':' suite
    
plus corresponding changes to compile.c and various
other files to track the change.

Also included is an updated version of Guido's
test_decorators.py.  The rest of the test suite
passes (apart from two tests which were fail
independently of this change).
msg45725 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2004-10-21 03:27
Logged In: YES 
user_id=33168

Since @decorator syntax was chosen, there's no reason to
keep this patch open.
History
Date User Action Args
2022-04-11 14:56:03adminsetgithub: 40132
2004-04-08 23:37:30mark_t_russellcreate