A decorator with a side effect *elsewhere* (like the route registrations)
is acceptable; one with a side effect *on the decorated function* is
questionable, and instead the decorator should behave "functionally", i.e.
return a new object instead.

On Wed, Nov 26, 2014 at 5:07 PM, Chris Angelico <[email protected]> wrote:

> On Thu, Nov 27, 2014 at 12:01 PM, Guido van Rossum <[email protected]>
> wrote:
> > Well, that's just a general problem with decorator ordering.
>
> Indeed. I was hoping it could be avoided in this instance by just
> altering __code__ on an existing function, but if that's not possible,
> we fall back to what is, after all, a known and documented concern.
>
> ChrisA
> _______________________________________________
> Python-Dev mailing list
> [email protected]
> 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)
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to