◐ Shell
reader mode source ↗
Skip to content

bpo-20285: Improve help docs for object#4759

Merged
csabella merged 7 commits into
python:masterfrom
csabella:bpo20285
May 24, 2019
Merged

bpo-20285: Improve help docs for object#4759
csabella merged 7 commits into
python:masterfrom
csabella:bpo20285

Conversation

@csabella

@csabella csabella commented Dec 9, 2017

Copy link
Copy Markdown
Contributor

Improve the docstring for object and show object methods when using help(object).

https://bugs.python.org/issue20285

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide comment

Wouldn't the beginners be confused by the term "superclass"?

@terryjreedy terryjreedy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide 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.

  1. Replace the current docstring. I think my initial proposal needs at least one word added and further changes are up for discussion.

  2. 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.

@bedevere-bot

Copy link
Copy Markdown

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@csabella

Copy link
Copy Markdown
Contributor Author

@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!

@terryjreedy

Copy link
Copy Markdown
Member

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.

@terryjreedy

Copy link
Copy Markdown
Member

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."

@csabella

Copy link
Copy Markdown
Contributor Author

@terryjreedy I've applied the changes. Thanks!

@terryjreedy

Copy link
Copy Markdown
Member

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.

@csabella

Copy link
Copy Markdown
Contributor Author

Thanks @terryjreedy! It looks like all the CI tests have passed, so I"m going to merge this.

@csabella csabella merged commit c95c93d into python:master May 24, 2019
@csabella csabella deleted the bpo20285 branch May 24, 2019 10:43
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants