Hello.  Yes, I meant TypeError.  I was thinking about this and it
seems like this would be pretty expensive.  We're basically trying to
figure out the signature of the function being called, and then
eliminating spurious dictionary key/values from the input to match the
signature to avoid the TypeError.  Is there any other way?  I feel
that this expensive given that it's going to happen on every action
call on the site.

thanks,

Sam.

On Feb 17, 2:49 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> On 17 fév, 20:33, SamDonaldson <[EMAIL PROTECTED]> wrote:
>
> > Hello,
>
> > My pylons actions are setup such that a decorator passes in the *args,
> > **kw request params coming from the user.  The problem is when
> > spurious args are passed in.  I get an AttributeError exception since
> > the signature of these actions don't take some of those arguments.
>
> An AttributeError ??? That should be a TypeError.
>
> > How do I make is so that I can take care of this case without having
> > to pass **kw to every action signature sort of like a catch-all.  Is
> > there a way to get details on the python function about to get called
> > and to modify the arguments to only pass those that correspond to the
> > signature?
>
> import inspect
> inspect.getargspec(somefunction)
>
> I once wrote some code doing this, but I don't know if there's still a
> copy somewhere. Anyway, that's rather trivial (and somewhat
> boring...).
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to