Message205340
I think we can now agree that docstrings other than the class docstring (used as a fallback) are not relevant to signature detection. And Raymond gave namedtuple classes the docstring needed as a fallback.
We are off-issue here, but idlelib.CallTips.get_argspec() is also ignorant that it may need to look at .__new__. An object with a C-coded .__init__ and Python-coded .__new__ is new to new-style classes. The new inspect.signature function handles such properly. Starting with a namedtuple Point (without the default docstring):
>>> from inspect import signature
>>> str(signature(Point.__new__))
'(_cls, x, y)'
>>> str(signature(Point))
'(x, y)'
The second is what autodoc should use. I just opened #19903 to update Idle to use signature. |
|
Date |
User |
Action |
Args |
2013-12-06 00:27:33 | terry.reedy | set | recipients:
+ terry.reedy, gvanrossum, rhettinger, giampaolo.rodola, eric.snow, serhiy.storchaka, pconnell, Ankur.Ankan |
2013-12-06 00:27:32 | terry.reedy | set | messageid: <1386289652.97.0.523505500986.issue16669@psf.upfronthosting.co.za> |
2013-12-06 00:27:32 | terry.reedy | link | issue16669 messages |
2013-12-06 00:27:32 | terry.reedy | create | |
|