[Python-Dev] Please reconsider PEP 479.

Chris Angelico rosuav at gmail.com
Thu Nov 27 01:57:07 CET 2014


On Thu, Nov 27, 2014 at 11:50 AM, Guido van Rossum <guido at python.org> wrote:
> No, that was a figure of speech. The proposed decorator returns a new
> function object that references a new code object. The original function and
> code object are unchanged.

Then it has a potentially-confusing interaction with decorators like
Flask's app.route(), which return the original function unchanged, but
also save a reference to it elsewhere. The order of decoration
determines the effect of the @hettinger decorator; there will be two
functions around which are almost, but not entirely, identical, and
it'd be very easy to not notice that you decorated in the wrong order.

ChrisA


More information about the Python-Dev mailing list