mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
gh-134082: modernize string.Formatter
class docstring (#134125)
fixup Formatter class docstring
This commit is contained in:
parent
4e9005d32f
commit
22e4a40d90
1 changed files with 5 additions and 8 deletions
|
@ -191,16 +191,14 @@ class Template:
|
||||||
|
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# the Formatter class
|
# The Formatter class (PEP 3101).
|
||||||
# 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 overall parser is implemented in _string.formatter_parser.
|
# 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:
|
class Formatter:
|
||||||
|
"""See PEP 3101 for details and purpose of this class."""
|
||||||
|
|
||||||
def format(self, format_string, /, *args, **kwargs):
|
def format(self, format_string, /, *args, **kwargs):
|
||||||
return self.vformat(format_string, args, kwargs)
|
return self.vformat(format_string, args, kwargs)
|
||||||
|
|
||||||
|
@ -293,7 +291,6 @@ class Formatter:
|
||||||
Return an iterable that contains tuples of the form
|
Return an iterable that contains tuples of the form
|
||||||
(literal_text, field_name, format_spec, conversion).
|
(literal_text, field_name, format_spec, conversion).
|
||||||
|
|
||||||
|
|
||||||
*field_name* can be None, in which case there's no object
|
*field_name* can be None, in which case there's no object
|
||||||
to format and output; otherwise, it is looked up and
|
to format and output; otherwise, it is looked up and
|
||||||
formatted with *format_spec* and *conversion*.
|
formatted with *format_spec* and *conversion*.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue