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

2009-02-16 Thread Gustavo Narea
On Feb 16, 5:18 pm, Michele Simionato wrote: > On Feb 16, 4:59 pm, Gustavo Narea wrote: > > > > > I've not seen anything special in Pylons or TurboGears 2 decorators, > > except that they are all functions that use the decorator package -- > > while my decorator is a class that doesn't use the de

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

2009-02-16 Thread Michele Simionato
On Feb 16, 4:59 pm, Gustavo Narea wrote: > I've not seen anything special in Pylons or TurboGears 2 decorators, > except that they are all functions that use the decorator package -- > while my decorator is a class that doesn't use the decorator package > yet. > > My attempt to turn that decorator

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

2009-02-16 Thread Gustavo Narea
On Feb 16, 4:59 pm, Gustavo Narea wrote: > On Feb 16, 4:40 pm, Michele Simionato > wrote: > > > > > > 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 bec

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

2009-02-16 Thread Gustavo Narea
On Feb 16, 4:40 pm, Michele Simionato wrote: > > 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

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

2009-02-16 Thread Michele Simionato
On Feb 16, 4:29 pm, Gustavo Narea wrote: > On Feb 16, 4:18 pm, Michele Simionato > 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

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

2009-02-16 Thread Gustavo Narea
On Feb 16, 4:18 pm, Michele Simionato 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 b

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

2009-02-16 Thread Michele Simionato
On Feb 16, 4:07 pm, Gustavo Narea wrote: > But the problem is that it is broken. > > That decorator is for controller actions in Pylons-powered web > applications (which are instance methods). Pylons inspects the > action's signature to find what parameters it's going to pass to its > instance met

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

2009-02-16 Thread Gustavo Narea
On Feb 16, 3:56 pm, Michele Simionato wrote: > On Feb 16, 3:50 pm, Gustavo Narea wrote: > > > On Feb 14, 3:27 pm, Michele Simionato > > wrote: > > > > I lack the context to see how this could be fixed in your case, but > > > this a not a show stopper, you can just keep the original decorator > >

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

2009-02-16 Thread Michele Simionato
On Feb 16, 3:50 pm, Gustavo Narea wrote: > On Feb 14, 3:27 pm, Michele Simionato > wrote: > > > I lack the context to see how this could be fixed in your case, but > > this a not a show stopper, you can just keep the original decorator > > and forget about making itsignature preserving. > > I'm s

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

2009-02-16 Thread Gustavo Narea
On Feb 14, 3:27 pm, Michele Simionato wrote: > I lack the context to see how this could be fixed in your case, but > this a not a show stopper, you can just keep the original decorator > and forget about making itsignature preserving. I'm sorry for the possibly dumb question, but how can I do tha

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

2009-02-15 Thread Michele Simionato
On Feb 14, 3:27 pm, Michele Simionato wrote: > I should probably raise a clearer error message. Ok, I have uploaded version 3.0.1 of the decorator module, which raises a more meaningful message in case you try to decorate a method incorrectly. I have also added a discussion of that case in the "c

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

2009-02-14 Thread Michele Simionato
On Feb 14, 1:30 pm, Gustavo Narea wrote: > This is what I get: > """ > (Pdb) func.__name__ > 'greetings' > (Pdb) func.__dict__ > {} > (Pdb) func.__module__ > 'pylonsproject.controllers.root' > """ > > Which seems correct to me. > > By the way, I forgot to mention that what is decorated is an insta

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

2009-02-14 Thread Gustavo Narea
On Feb 14, 6:38 am, Michele Simionato wrote: > On Feb 14, 12:56 am, Gustavo Narea wrote: > > > > > Hello, everybody. > > > I have this signature-changing decorator > > > > which I > > want to turn into a signature-preserving one.

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

2009-02-13 Thread Michele Simionato
On Feb 14, 12:56 am, Gustavo Narea wrote: > Hello, everybody. > > I have this signature-changing decorator > > which I > want to turn into a signature-preserving one. Here's my try >

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

2009-02-13 Thread Gustavo Narea
Hello, everybody. I have this signature-changing decorator which I want to turn into a signature-preserving one. Here's my try , but I get this error: http://paste