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 kermode
Recipients benjamin.peterson, georg.brandl, gpolo, kermode
Date 2008-12-31.21:17:53
SpamBayes Score 1.6940137e-05
Marked as misclassified No
Message-id <1230758274.52.0.977124764157.issue4793@psf.upfronthosting.co.za>
In-reply-to
Content
The claim "merely" syntactic sugar implies that the inverse is also
true, the decorator expression:

@do_something
def foo():
    ....

can be replaced it with:

def foo():
    ....
foo = do_something(foo)

This is guaranteed if do_something is purely functional, but breaks if
do_something has side effects. The example was for illustration only. A
real application would likely access the parent frame. Whether or not
this is a questionable practice, it happens.

However, the issue is one of definitions. Is the phrase "merely
syntactic sugar" misleading? In this case it makes promises that may not
be kept.
History
Date User Action Args
2008-12-31 21:17:54kermodesetrecipients: + kermode, georg.brandl, benjamin.peterson, gpolo
2008-12-31 21:17:54kermodesetmessageid: <1230758274.52.0.977124764157.issue4793@psf.upfronthosting.co.za>
2008-12-31 21:17:53kermodelinkissue4793 messages
2008-12-31 21:17:53kermodecreate