-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
gh-136897: Update docstring of str.translate
#136954
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
base: main
Are you sure you want to change the base?
gh-136897: Update docstring of str.translate
#136954
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
str.translate
str.translate
In the future, please use the title format you had in the issues description. |
@StanFromIreland ok 🙌 |
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.
Thanks!
Translation table, which must be a mapping of Unicode ordinals to | ||
Unicode ordinals, strings, or None. | ||
Translation table, which must be an object that implements indexing via __getitem__(), | ||
typically a mapping or sequence. |
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.
Please, explain "a mapping or sequence" of "what" :)
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 is like this in the docs, do we want to update it too?
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.
I can update both online docs(original one) and that docstring I've changed, shall we proceed with that ?
Translation table, which must be a mapping of Unicode ordinals to | ||
Unicode ordinals, strings, or None. |
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 original wording is clearer, it describes what the object is semantically, not just the type and protocol. "a mapping of ordinals to ..." is not necessarily the same as an object conforming to the Mapping
protocol.
gh-136897: Update docstring of
str.translate
As mentioned in the issue, I've updated docstring to "match" it with online docs then ran
make clinic
.