Is it possible to determine what a function needs for parameters -

Chris Mellon arkanes at gmail.com
Wed May 2 11:27:24 EDT 2007


On 2 May 2007 08:13:12 -0700, rh0dium <steven.klass at gmail.com> wrote:
> > This is far more work than you need. Push an (args, kwargs) tuple into
> > your arguments queue and call self.function(*args, **kwargs).
>
> No see I tried that and that won't work.
>
> I'm assuming what you are referring to is this (effectively)
>
> Q.put(((),{a:"foo", b:"bar}))
>
> input = Q.get()
> self.function( *input[0], **input[1])
>
> This will obviously fail if several conditions aren't met - hence the
> kludge.  Am I missing something here?
>

Assuming that the caller correctly pushes arguments, how can this fail?



More information about the Python-list mailing list