Nick, thanks for writing this patch!
> That's probably OK though - previously those wouldn't report signatures at all.
I honestly don't think it is OK. I think we should stick to the behaviour of old 'getfullargspec' consistently, to make its behaviour always predictable.
I further tweaked your patch, please review the new one (*_02.diff)
The changes are relatively simple -- I've added a new bool flag to '_signature_internal' -- skip_bound_arg. When it is False, the logic for skipping bound args is off. It also made 'getfullargspec' implementation simpler.
Now 'getfullargspec()' should behave always like it did before + it will handle more callables.
Larry, if you have some time for this, I'd be glad to receive your feedback on this. This issue is quite important. |