[issue20710] Make inspect and pydoc consistent about bound methods

Yury Selivanov report at bugs.python.org
Fri Feb 21 02:06:47 CET 2014


Yury Selivanov added the comment:

> So why is it necessary (and a release blocker) to fix a bug in inspect._signature_fromstr, but a terrible idea to fix a bug in inspect.ismethod?

I was actually writing a comment, when I received this on my email ;) Let me explain my point of view.

> And the overwhelming majority voted +1 for "don't show self for bound methods".  So I'd like to change it for 3.4.

Sorry, I didn't know about it. I lost track of the relevant issue, and thought that we still need to keep the old behaviour in tact.

> inspect.ismethod() returns False for bound methods on builtins.

I'm +1 in principle, the only thing that bugs me, is that 'ismethod' is probably 100x more popular API then signature, and event getfullargspec. I'm just not sure what are the consequences.  Maybe, it's possible to fix pydoc without touching 'ismethod'?  My 2 cents.

Now, about the newly discovered bug in getfullargspec() [and _signature_fromstr]. I put a "release blocker" on that issue because it's a new change, that 'getfullargspec' now uses 'inspect.signature', and I don't think we should ship this new feature broken. But certainly, it's up to you to let this in 3.4.0.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20710>
_______________________________________


More information about the Python-bugs-list mailing list