Turning a signature-changing decorator into a signature-preserving one

Michele Simionato michele.simionato at gmail.com
Mon Feb 16 10:40:08 EST 2009


On Feb 16, 4:29 pm, Gustavo Narea <m... at gustavonarea.net> wrote:
> On Feb 16, 4:18 pm, Michele Simionato <michele.simion... at gmail.com>
> wrote:
>
> > Yes, I am saying don't mess with the internal mechanism of Pylons and
> > leave it as
> > it was. Or was it broken from the beginning? The only reason I see for
> > you
> > to touch those things is if you are a Pylons core developer.
>
> It was broken from the beginning on Pylons.
>
> I'm a TurboGears 2 core developer, and TurboGears is powered by Pylons
> as of version 2. The decorator has always worked in TurboGears because
> of the way TG finds the action arguments, but now I'm working to make
> it work in Pylons too, but this is the only problem that has stopped
> me from making it work under Pylons.
>
> Thanks.

I see. I would ask on the Pylons list. I suspect a bound method is
passed and that you will
need to extract the corresponding function with .im_func, then making
sure that you pass
the self argument correctly. But this is wild guess since I have no
idea of how Pylons decorators
work internally as compared to TurboGears decorators.



More information about the Python-list mailing list