-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-103886: Improve builtins.__doc__
#104179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good, thanks! I'll ask for some more feedback from others.
Co-authored-by: Jelle Zijlstra <[email protected]>
@tomasr8: note that we do not use force-push in our workflow. Force-pushing does not play well with the GitHub UI, and it can be frustrating for the reviewer. So, for the reviewers convenience, please use |
I accidentally committed with the wrong email 😄 (not under CLA) so force pushing was necessary to fix that.. sorry about that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great!
On current main
:
>>> import builtins
>>> help(builtins)
Help on built-in module builtins:
NAME
builtins - Built-in functions, exceptions, and other objects.
DESCRIPTION
Noteworthy: None is the `nil' object; Ellipsis represents `...' in slices.
(etc. for many lines)
With this PR (after rebuilding Python):
>>> import builtins
>>> help(builtins)
Help on built-in module builtins:
NAME
builtins - Built-in functions, types, exceptions, and other objects.
DESCRIPTION
This module provides direct access to all 'built-in'
identifiers of Python; for example, builtins.open is
the full name for the built-in function open().
This module is not normally accessed explicitly by most
applications, but can be useful in modules that provide
objects with the same name as a built-in value, but in
which the built-in of that name is also needed.
The new version is far more helpful.
BTW, we don't need a NEWS entry for this. Can you please remove it? |
Co-authored-by: Jelle Zijlstra <[email protected]>
Thanks @tomasr8 for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
GH-104257 is a backport of this pull request to the 3.11 branch. |
(cherry picked from commit b35711d) Co-authored-by: Tomas R <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]>
gh-103886: Improve `builtins.__doc__` (GH-104179) (cherry picked from commit b35711d) Co-authored-by: Tomas R <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]>
Co-authored-by: Jelle Zijlstra <[email protected]>
I basically took the explanation from the docs since the module's already explained very well there.
I thought it wasn't necessary to point out
Ellipsis
specifically while not mentioning any other objects (and you can always use...
instead ofEllipsis
anyway..)builtins.__doc__
#103886