Skip to content

Commit 6312b39

Browse files
committed
init
1 parent 808071b commit 6312b39

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

Doc/library/string.rst

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ implementation as the built-in :meth:`~str.format` method.
116116
into character data and replacement fields. It calls the various
117117
methods described below.
118118

119+
Auto-numbering of non-numbered positional fields is done after
120+
calling :meth:`parse` and before :meth:`get_field`.
121+
119122
In addition, the :class:`Formatter` defines a number of methods that are
120123
intended to be replaced by subclasses:
121124

@@ -133,14 +136,18 @@ implementation as the built-in :meth:`~str.format` method.
133136
field, then the values of *field_name*, *format_spec* and *conversion*
134137
will be ``None``.
135138

139+
The value of *field_name* is unmodified user input and auto-numbering of
140+
non-numbered positional fields is done by :meth:`vformat`.
141+
136142
.. method:: get_field(field_name, args, kwargs)
137143

138-
Given *field_name* as returned by :meth:`parse` (see above), convert it to
139-
an object to be formatted. Returns a tuple (obj, used_key). The default
140-
version takes strings of the form defined in :pep:`3101`, such as
141-
"0[name]" or "label.title". *args* and *kwargs* are as passed in to
142-
:meth:`vformat`. The return value *used_key* has the same meaning as the
143-
*key* parameter to :meth:`get_value`.
144+
Given *field_name*, convert it to an object to be formatted.
145+
Auto-numbering of *field_name* returned from :meth:`parse` is done by
146+
:meth:`vformat` before calling this method. Returns a tuple (obj, used_key).
147+
The default version takes strings of the form defined in :pep:`3101`,
148+
such as "0[name]" or "label.title". *args* and *kwargs* are as passed in to
149+
:meth:`vformat`. The return value *used_key* has the same meaning
150+
as the *key* parameter to :meth:`get_value`.
144151

145152
.. method:: get_value(key, args, kwargs)
146153

0 commit comments

Comments
 (0)