-
-
Notifications
You must be signed in to change notification settings - Fork 34.6k
gh-137609: Update signatures of builtins in the documentation #137610
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
Merged
serhiy-storchaka
merged 18 commits into
python:main
from
serhiy-storchaka:docs-builtins-signatures
Aug 25, 2025
+152
−146
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
5f13e6f
gh-137609: Update signatures of builtins in the documentation
serhiy-storchaka 72157aa
Use less signatures and more default values.
serhiy-storchaka d08e13f
Merge branch 'main' into docs-builtins-signatures
AA-Turner 94cc645
Update Doc/library/functions.rst
AA-Turner 899cc86
Fix error with stop/end, update chr() and ord(), change kwdto kwargs.
serhiy-storchaka e82b3e8
Merge branch 'main' into docs-builtins-signatures
serhiy-storchaka a0f5a73
ord() only supports bytes and bytearray.
serhiy-storchaka 68706c2
Merge branch 'main' into docs-builtins-signatures
serhiy-storchaka b159ccd
Rename "bytes" back to "chars".
serhiy-storchaka c2068d2
Revert "Rename "bytes" back to "chars"."
serhiy-storchaka c06089f
Remove outdated explanation of the "chars" name.
serhiy-storchaka 8b5e802
Add missed '/'s.
serhiy-storchaka de15f70
Add a signature for weird str() case.
serhiy-storchaka 150ad5b
Update Doc/library/stdtypes.rst
serhiy-storchaka 402efa9
mamoryview.index() has parameter "stop".
serhiy-storchaka 61754a3
Add signatures for str.maketrans().
serhiy-storchaka 816dea7
Revert changes for signatures with start/end indices.
serhiy-storchaka 2961fff
Merge branch 'main' into docs-builtins-signatures
serhiy-storchaka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add a signature for weird str() case.
- Loading branch information
commit de15f70106ef0e62b840c37f1f2e4d30bf600e14
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It's technically true that you can pass just the encoding or errors kwargs (like
str(encoding='ebcdic')), but it's not practically useful, since you just get an empty string whatever encoding you pass, and I fear it's confusing to users to put this here.The old docs here feel clearer even if they're not as precise.
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.
We should be technically correct.
Several years ago I proposed to deprecate this case, but my proposition was rejected. If it is worth to continue supporting this in code, it is worth to document it. Note that values of encoding and errors are ignored: