Skip to content

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.

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think that there is a problem with the original docstring, and I do not think that this PR makes it more clear.

@AA-Turner AA-Turner added the pending The issue will be closed if no feedback is provided label Aug 26, 2025
@AbduazizZiyodov
Copy link
Author

Good then

@AA-Turner AA-Turner removed the pending The issue will be closed if no feedback is provided label Aug 26, 2025
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.

5 participants