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.

Author james
Recipients james
Date 2013-11-20.01:27:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1384910825.18.0.00604679093295.issue19660@psf.upfronthosting.co.za>
In-reply-to
Content
Decorator syntax currently allows only a dotted_name after the @. As far as I can tell, this was a gut-feeling decision made by Guido. [1]

I spoke with Nick Coghlan at PyTexas about this, and he suggested that if someone did the work, there might be interest in revisiting this restriction.

The attached patch allows any testlist to follow the @.

The following are now valid:

@(lambda x:x)
def f():
    pass

@(spam if p else eggs)
def f():
    pass

@spam().ham().eggs()
def f():
    pass

[1] http://mail.python.org/pipermail/python-dev/2004-August/046711.html
History
Date User Action Args
2013-11-20 01:27:05jamessetrecipients: + james
2013-11-20 01:27:05jamessetmessageid: <1384910825.18.0.00604679093295.issue19660@psf.upfronthosting.co.za>
2013-11-20 01:27:05jameslinkissue19660 messages
2013-11-20 01:27:04jamescreate