Skip to content

gh-72798: Add mapping example to str.translate documentation#144454

Open
kovan wants to merge 1 commit intopython:mainfrom
kovan:gh-72798-str-translate-example
Open

gh-72798: Add mapping example to str.translate documentation#144454
kovan wants to merge 1 commit intopython:mainfrom
kovan:gh-72798-str-translate-example

Conversation

@kovan
Copy link
Contributor

@kovan kovan commented Feb 3, 2026

Summary

  • Adds an example showing how to use str.translate with a dictionary mapping directly
  • Demonstrates character replacement ('a''X', 'b''Y') and deletion ('c'None)

Test plan

  • make check passed
  • Documentation builds correctly

🤖 Generated with Claude Code


📚 Documentation preview 📚: https://cpython-previews--144454.org.readthedocs.build/

Add an example showing how to use str.translate with a dictionary
mapping directly, demonstrating character replacement and deletion.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

1 participant