From 85488c79cbf2c1b4185fe60aae4a76dab0946c63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= <10796600+picnixz@users.noreply.github.com> Date: Sat, 17 May 2025 09:53:01 +0200 Subject: [PATCH] fixup Formatter class docstring --- Lib/string/__init__.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Lib/string/__init__.py b/Lib/string/__init__.py index b7782e042b94eb..b788d7136f1ae3 100644 --- a/Lib/string/__init__.py +++ b/Lib/string/__init__.py @@ -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) @@ -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*.