Re: [Python-Dev] how to inspect if something includes a bound first param

2015-02-25 Thread Larry Hastings
On 02/24/2015 05:56 PM, Gregory P. Smith wrote: inspect.getargspec(method) and inspect.signature(method) both include the 'self' parameter but how are we to figure out from method itself that it is actually bound and that its first parameter is expected to be a bound instance? Given the

[Python-Dev] how to inspect if something includes a bound first param

2015-02-24 Thread Gregory P. Smith
inspect.getargspec(method) and inspect.signature(method) both include the 'self' parameter but how are we to figure out from method itself that it is actually bound and that its first parameter is expected to be a bound instance? So far I've come up with: *inspect.ismethod(method) or

Re: [Python-Dev] how to inspect if something includes a bound first param

2015-02-24 Thread Eric V. Smith
On 2/24/2015 8:56 PM, Gregory P. Smith wrote: inspect.getargspec(method) and inspect.signature(method) both include the 'self' parameter but how are we to figure out from method itself that it is actually bound and that its first parameter is expected to be a bound instance? So far I've

Re: [Python-Dev] how to inspect if something includes a bound first param

2015-02-24 Thread Terry Reedy
On 2/24/2015 8:56 PM, Gregory P. Smith wrote: inspect.getargspec(method) and inspect.signature(method) both include the 'self' parameter but how are we to figure out from method itself that it is actually bound and that its first parameter is expected to be a bound instance? This seems like a

Re: [Python-Dev] how to inspect if something includes a bound first param

2015-02-24 Thread Terry Reedy
On 2/24/2015 9:02 PM, Eric V. Smith wrote: I'm not sure if it's correct, but deep in a library of mine I have: elif type(fn) == types.MethodType: # bound method? if fn.im_self is None: # no 'self' nskip = 0 else: # need to supply 'self' nskip =