Uh oh!
There was an error while loading. Please reload this page.
gh-106318: Add string method examples - #119445
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Fix indentation
| >>> 'Python'.rjust(10, '.') | ||
| '....Python' | ||
| The original string is returned if *width* is less than or equal to ``len(s)``. |
There was a problem hiding this comment.
I think this might fix the Sphinx error:
| The original string is returned if *width* is less than or equal to ``len(s)``. | |
| The original string is returned if *width* is less than or equal to ``len(s)``. |
For some reason, reST is usually indented in multiples of 3 spaces.
blaisep
commented
Jun 7, 2024
I'll update this with the suggestions from https://www.youtube.com/live/-0SXSTkJsfg?si=yRQG9Pm0ochACy_x&t=3883 |
From office hours at https://www.youtube.com/live/-0SXSTkJsfg?si=QKhDzyWPVvWRLcDO&t=4267 Co-authored-by: Lisa Crispin <lisa.crispin@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
blaisep
commented
Jun 13, 2024
Yes, I am marking this draft and going over it much more carefully. BTW, @adorilson , I will be in UTC-4 for the rest of the week and happy to pair up on this if you like. I'll add you to my fork. |
Fix doctest formatting errors
| ... | ||
| >>> '{name} was born in {country}'.format_map(Default(name='Guido')) | ||
| >>> '{name} was born in {country}'.format_map(Default(name='Guido', country='Netherlands')) | ||
| 'Guido was born in country' |
There was a problem hiding this comment.
This is supposed to be:
'Guido was born in Netherlands'
However, I think the previous example is more valuable. It shows the two Default class behaviour.
adorilson
commented
Feb 7, 2026
It could be closed in favor of all other PR linked to #106318 |
This PR reformats the examples created by @adorilson in #105670
I followed the discussion in a related PR #111743 , and then discussed it with @encukou and @CAM-Gerlach .
We decided that the fastest way to get the content into the docs was to edit the
stdtypes.rstto include various suggestions and to have me update the related PRSo I pulled the branch, resolved merge conflicts, edited the file and created this PR.
Mentioning others who might be interested:
@hauntsaninja , @CAM-Gerlach , @encukou
📚 Documentation preview 📚: https://cpython-previews--119445.org.readthedocs.build/en/119445/library/stdtypes.html