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-134082: modernizestring.Formatter class docstring#134125

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

Merged
picnixz merged 1 commit intopython:mainfrompicnixz:fix/string-formatter/134083
May 18, 2025
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletionsLib/string/__init__.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -191,16 +191,14 @@ def get_identifiers(self):


########################################################################
# the Formatter class
# see PEP 3101 for details and purpose of this class

# The hard parts are reused from the C implementation. They're exposed as "_"
# prefixed methods of str.

# The Formatter class (PEP 3101).
#
# The overall parser is implemented in _string.formatter_parser.
# The field name parser is implemented in _string.formatter_field_name_split
# The field name parser is implemented in _string.formatter_field_name_split.

class Formatter:
"""See PEP 3101 for details and purpose of this class."""

def format(self, format_string, /, *args, **kwargs):
return self.vformat(format_string, args, kwargs)

Expand DownExpand Up@@ -293,7 +291,6 @@ def parse(self, format_string):
Return an iterable that contains tuples of the form
(literal_text, field_name, format_spec, conversion).


*field_name* can be None, in which case there's no object
to format and output; otherwise, it is looked up and
formatted with *format_spec* and *conversion*.
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp