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 georg.brandl, gpolo, kermode
Date 2008-12-31.19:44:25
SpamBayes Score 0.00170899
Marked as misclassified No
Message-id <>
It is distinct behavior. Without a decorator a new function is
immediately assigned to the identifier. Any previous reference is lost.
A decorator postpones assignment until the decorator returns. That
allows the decorator to access the previous object. I don't know of any
way to do the same thing with:

def foo():
foo = do_something(foo)

Here is part of a comp.lang.python thread discussing the possibility of
using a decorator for an overloaded function.

Note that the decorator could create an overloaded function without any
extra variables. To do the equivalent in Python 2.3 a special attribute,
with a mangled name, was needed to store intermediate declarations.
Date User Action Args
2008-12-31 19:44:27kermodesetrecipients: + kermode, georg.brandl, gpolo
2008-12-31 19:44:27kermodesetmessageid: <>
2008-12-31 19:44:26kermodelinkissue4793 messages
2008-12-31 19:44:25kermodecreate