Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-106318: Add string method examples#119445

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
blaisep wants to merge67 commits intopython:main
base:main
Choose a base branch
Loading
fromblaisep:pr-105670

Conversation

blaisep
Copy link
Contributor

@blaisepblaisep commentedMay 22, 2024
edited by hugovk
Loading

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 thestdtypes.rst to include various suggestions and to have meupdate 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

@blaisepblaisep marked this pull request as ready for reviewMay 28, 2024 07:05
>>> 'Python'.rjust(10, '.')
'....Python'

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

Choose a reason for hiding this comment

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

I think this might fix theSphinx 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 reacted with eyes emoji
@blaisepblaisep marked this pull request as draftJune 6, 2024 23:44
@blaisep
Copy link
ContributorAuthor

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

adorilson reacted with heart emoji

Copy link
Contributor

@adorilsonadorilson left a comment

Choose a reason for hiding this comment

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

I notice some possible errors,@blaisep

blaisep reacted with thumbs up emoji
@blaisep
Copy link
ContributorAuthor

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.

adorilson reacted with thumbs up emoji

Fix doctest formatting errors
@@ -1863,7 +1857,7 @@ expression support in the :mod:`re` module).
... def __missing__(self, key):
... return key
...
>>> '{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'
Copy link
Contributor

@adorilsonadorilsonJul 16, 2024
edited
Loading

Choose a reason for hiding this comment

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

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.

encukou and blaisep reacted with thumbs up emoji
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@encukouencukouencukou left review comments

@hugovkhugovkhugovk left review comments

@adorilsonadorilsonadorilson requested changes

@ammaraskarammaraskarAwaiting requested review from ammaraskarammaraskar will be requested when the pull request is marked ready for reviewammaraskar is a code owner

Assignees
No one assigned
Labels
docsDocumentation in the Doc dirskip news
Projects
Status: Todo
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

6 participants
@blaisep@adorilson@encukou@hugovk@willingc@hauntsaninja

[8]ページ先頭

©2009-2025 Movatter.jp