Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

AbduazizZiyodov
Copy link

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.

@bedevere-app

This comment has been minimized.

@AbduazizZiyodov
Copy link
Author

cc: @StanFromIreland @efimov-mikhail

@python-cla-bot
Copy link

python-cla-bot bot commented Jul 21, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app

This comment has been minimized.

@StanFromIreland StanFromIreland changed the title Update docstring of str.translate gh-136897: Update docstring of str.translate Jul 22, 2025
@StanFromIreland
Copy link
Member

In the future, please use the title format you had in the issues description.

@AbduazizZiyodov
Copy link
Author

@StanFromIreland ok 🙌

Copy link
Member

@sobolevn sobolevn left a 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.
Copy link
Member

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" :)

Copy link
Member

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?

Copy link
Author

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 ?

@AA-Turner AA-Turner added the docs Documentation in the Doc dir label Aug 3, 2025
@github-project-automation github-project-automation bot moved this to Todo in Docs PRs Aug 3, 2025
Comment on lines -13480 to -13481
Translation table, which must be a mapping of Unicode ordinals to
Unicode ordinals, strings, or None.
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review docs Documentation in the Doc dir skip news
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

4 participants