8000 gh-134082: modernize `string.Formatter` class docstring (#134125) · python/cpython@22e4a40 · GitHub
[go: up one dir, main page]

Skip to content

Commit 22e4a40

Browse files
authored
gh-134082: modernize strin 10000 g.Formatter class docstring (#134125)
fixup Formatter class docstring
1 parent 4e9005d commit 22e4a40

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

Lib/string/__init__.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -191,16 +191,14 @@ def get_identifiers(self):
191191

192192

193193
########################################################################
194-
# the Formatter class
195-
# see PEP 3101 for details and purpose of this class
196-
197-
# The hard parts are reused from the C implementation. They're exposed as "_"
198-
# prefixed methods of str.
199-
194+
# The Formatter class (PEP 3101).
195+
#
200196
# The overall parser is implemented in _string.formatter_parser.
201-
# The field name parser is implemented in _string.formatter_field_name_split
197+
# The field name parser is implemented in _string.formatter_field_name_split.
202198

203199
class Formatter:
200+
"""See PEP 3101 for details and purpose of this class."""
201+
204202
def format(self, format_string, /, *args, **kwargs):
205203
return self.vformat(format_string, args, kwargs)
206204

@@ -293,7 +291,6 @@ def parse(self, format_string):
293291
Return an iterable that contains tuples of the form
294292
(literal_text, field_name, format_spec, conversion).
295293
296-
297294
*field_name* can be None, in which case there's no object
298295
to format and output; otherwise, it is looked up and
299296
formatted with *format_spec* and *conversion*.

0 commit comments

Comments
 (0)
0