bpo-20285: Improve help docs for object#4759
Conversation
serhiy-storchaka
left a comment
There was a problem hiding this comment.
Wouldn't the beginners be confused by the term "superclass"?
Sorry, something went wrong.
terryjreedy
left a comment
There was a problem hiding this comment.
help(someclass) prints someclass.doc and then prints the methods defined 'here' (on someclass). The goal of the issue is to improve 'help(object)' in two ways.
-
Replace the current docstring. I think my initial proposal needs at least one word added and further changes are up for discussion.
-
Actually print the methods defined on object. The patch lists the same methods as returned by dir(object). The pydoc change looks correct to me. I presume that the format of the typeobject change is correct since Serhiy did not say otherwise.
Sorry, something went wrong.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Sorry, something went wrong.
|
@terryjreedy I don't quite understand what changes you'd like me to make. I changed the docstring to match what you asked about on the bug tracker for #1, but I'm not sure what you mean by 'Actually print the methods defined on object.'. Thanks! |
Sorry, something went wrong.
|
Your initial patch fixed the help output. The second has the wording I suggested on the issue. I will expand the news entry a bit. |
Sorry, something went wrong.
|
Absent an even better suggestion, I would like to go with this docstring, resulting from pydev discussion (see the tracker). "The base class of the class hierarchy. When called, it accepts no arguments and returns a new featureless instance that has no instance attributes and cannot be given any." |
Sorry, something went wrong.
|
help(object) now looks correct on my machine, after the update merge. Rather than run test suite locally, I pushed to have patch to core object tested with current code on all CI systems. I believe there have been other patches to object.c since last CI run. |
Sorry, something went wrong.
|
Thanks @terryjreedy! It looks like all the CI tests have passed, so I"m going to merge this. |
Sorry, something went wrong.
Improve the docstring for
objectand showobjectmethods when usinghelp(object).https://bugs.python.org/issue20285