Terry J. Reedy added the comment: 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. ---------- _______________________________________ Python tracker <[email protected]> <http://bugs.python.org/issue16669> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
