[Python-Dev] Please reconsider PEP 479.

Guido van Rossum guido at python.org
Thu Nov 27 02:01:05 CET 2014


Well, that's just a general problem with decorator ordering.

On Wed, Nov 26, 2014 at 4:57 PM, Chris Angelico <rosuav at gmail.com> wrote:

> 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
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> https://mail.python.org/mailman/options/python-dev/guido%40python.org
>



-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20141126/6a452302/attachment.html>


More information about the Python-Dev mailing list