Skip to content

Improve builtins.__doc__ #103886

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

Closed
JelleZijlstra opened this issue Apr 26, 2023 · 3 comments
Closed

Improve builtins.__doc__ #103886

JelleZijlstra opened this issue Apr 26, 2023 · 3 comments
Labels
docs Documentation in the Doc dir

Comments

@JelleZijlstra
Copy link
Member

JelleZijlstra commented Apr 26, 2023

>>> import builtins
>>> print(builtins.__doc__)
Built-in functions, exceptions, and other objects.

Noteworthy: None is the `nil' object; Ellipsis represents `...' in slices.
>>> 

A few possible improvements:

  • None is not actually in the builtins module, as it's a keyword
  • Ellipsis has more uses than just slices
  • The docstring doesn't explain what "builtins" means. It should say that this module is special in that its namespace is always available, or something along those lines.

Linked PRs

@JelleZijlstra JelleZijlstra added the docs Documentation in the Doc dir label Apr 26, 2023
@tomasr8
Copy link
Member

tomasr8 commented May 4, 2023

I guess we could reuse (to some degree) the builtins documentation?

JelleZijlstra added a commit that referenced this issue May 7, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 7, 2023
(cherry picked from commit b35711d)

Co-authored-by: Tomas R <[email protected]>
Co-authored-by: Jelle Zijlstra <[email protected]>
@JelleZijlstra
Copy link
Member Author

Much better now, thanks @tomasr8!

JelleZijlstra added a commit that referenced this issue May 7, 2023
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]>
@tomasr8
Copy link
Member

tomasr8 commented May 7, 2023

Thanks for the review!

jbower-fb pushed a commit to jbower-fb/cpython that referenced this issue May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

2 participants