Closed
Labels
docsDocumentation in the Doc dir
Description
The following PR updates signatures for all functions and classes in the builtins module. They now match the actual signatures or signatures after solving #73536.
- Consistently add the positional-only parameter mark. It is only used in some signatures, but in others it is not clear whether keyword arguments are accepted for all parameters or all parameters are positional-only.
- Changed the names of some positional-only parameters, for example
abs(x)->abs(number, /). - Replace non-Python signatures that use
[...]with Python signatures or multiple signatures. For example,str.center(width[, fillchar])->str.center(width, fillchar= ' ', /)andstr.count(sub[, start[, end]])->str.count(sub, start=0, stop=None, /).
Linked PRs
- gh-137609: Update signatures of builtins in the documentation #137610
- gh-137609: Change names of some positional-only parameters in builtins #137611
- [3.14] gh-137609: Update signatures of builtins in the documentation (GH-137610) #138137
- [3.13] gh-137609: Update signatures of builtins in the documentation (GH-137610) #138138
Reacted by Terry Jan Reedy, Kirill Podoprigora and M. Kocher
Metadata
Metadata
Assignees
Labels
docsDocumentation in the Doc dir
Projects
- StatusShow more project fieldsTodo
Activity
pythongh-137609: Update signatures of builtins in the documentation
pythongh-137609: Change names of some positional-only parameters in b…
pythongh-137609: Change names of some positional-only parameters in b…
serhiy-storchaka commentedon Aug 10, 2025
And #137611 changes the names of some positional-only parameters to match the documentation if the names in the documentation look better.
serhiy-storchaka commentedon Aug 15, 2025
I recall why
str.index()etc did not have machine-readable signatures.Noneas the range limits. Theindex()`` methods in other sequences only accept integers. I was not sure whether acceptingNone` is an official feature or an implementation detail.end, but in other sequences it has namestop.gh-137609: Update signatures of builtins in the documentation (GH-137610
pythongh-137609: Update signatures of builtins in the documentation (p…
[3.13] pythongh-137609: Update signatures of builtins in the document…
gh-137609: Change names of some positional-only parameters in builtins (
[3.13] gh-137609: Update signatures of builtins in the documentation (G…
[3.14] gh-137609: Update signatures of builtins in the documentation (G…
[3.14] pythongh-137609: Update signatures of builtins in the document…