Zachary Ware added the comment:

I don't think there's any danger of changing inspect.Signature's behavior here; 
it's doing the right thing.  What we're concerned with here is just making sure 
that the output of 'help(some_kind_of_method)' is equivalent to the output of 
'help(some_kind_of_method_in_C)', which should just mean changes to pydoc.

pydoc currently shows the 'self' parameter because before trying to find the 
signature, it replaces the object it is looking at with that object's __func__ 
attribute (see Lib/pydoc.py:1315).  To get rid of that behavior for 
Python-implemented methods is as simple as removing that line.

Is that the route we want to go, though?  It makes sense and it does make 
Python and C methods (mostly) match so I'd be happy with it, but it does change 
the help output for every Python-implemented method.

There is still the issue that the help output for C-implemented methods don't 
say anything about whether they're bound or not, but that issue is just a 
sibling to this one.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20379>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to