FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-106318: Add string method examples by blaisep · Pull Request #119445 · python/cpython · GitHub

Repository navigation

gh-106318: Add string method examples - #119445

Closed
blaisep wants to merge 67 commits into
python:mainfrom
blaisep:pr-105670
Closed

blaisep wants to merge 67 commits into
python:mainfrom
blaisep:pr-105670

Conversation

blaisep commented May 22, 2024 •
edited by hugovk
Loading

Copy link
Copy Markdown
Contributor

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.rst to include various suggestions and to have me update the related PR
So 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

adorilson added 30 commits June 11, 2023 19:43
blaisep marked this pull request as ready for review May 28, 2024 07:05

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This change needs reverting.

Comment thread Doc/library/stdtypes.rst
Comment thread Doc/library/stdtypes.rst
Comment thread Doc/library/stdtypes.rst
Comment thread Doc/library/stdtypes.rst Outdated
Comment thread Doc/library/stdtypes.rst Outdated
Comment thread Doc/library/stdtypes.rst
Comment thread Doc/library/stdtypes.rst Outdated
Comment thread Doc/library/stdtypes.rst Outdated
Comment thread Doc/library/stdtypes.rst Outdated
Comment thread Doc/library/stdtypes.rst
Comment thread Doc/library/stdtypes.rst Outdated
Comment thread Doc/library/stdtypes.rst
Comment thread Doc/library/stdtypes.rst Outdated
Comment thread Doc/library/stdtypes.rst Outdated
Comment thread Doc/library/stdtypes.rst
>>> 'Python'.rjust(10, '.')
'....Python'

The original string is returned if *width* is less than or equal to ``len(s)``.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think this might fix the Sphinx error:

Suggested change
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 marked this pull request as draft June 6, 2024 23:44

blaisep commented Jun 7, 2024

Copy link
Copy Markdown
Contributor Author

I'll update this with the suggestions from https://www.youtube.com/live/-0SXSTkJsfg?si=yRQG9Pm0ochACy_x&t=3883

Comment thread Doc/library/stdtypes.rst Outdated
Comment thread Doc/library/stdtypes.rst
Comment thread Doc/library/stdtypes.rst

adorilson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I notice some possible errors, @blaisep

blaisep commented Jun 13, 2024

Copy link
Copy Markdown
Contributor Author

I notice some possible errors, @blaisep

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
Comment thread Doc/library/stdtypes.rst
...
>>> '{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'

adorilson Jul 16, 2024 •
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Copy link
Copy Markdown
Contributor

It could be closed in favor of all other PR linked to #106318

hugovk closed this Feb 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL