FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-89867: string.Formatter auto numbering doc updates by dg-pb · Pull Request #129617 · python/cpython · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
16 changes: 9 additions & 7 deletions Doc/library/string.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,18 @@ implementation as the built-in :meth:`~str.format` method.
(which can happen if two replacement fields occur consecutively), then
*literal_text* will be a zero-length string. If there is no replacement
field, then the values of *field_name*, *format_spec* and *conversion*
will be ``None``.
will be ``None``. The value of *field_name* is unmodified and
auto-numbering of non-numbered positional fields is done by :meth:`vformat`.

.. method:: get_field(field_name, args, kwargs)

Given *field_name* as returned by :meth:`parse` (see above), convert it to
an object to be formatted. Returns a tuple (obj, used_key). The default
version takes strings of the form defined in :pep:`3101`, such as
"0[name]" or "label.title". *args* and *kwargs* are as passed in to
:meth:`vformat`. The return value *used_key* has the same meaning as the
*key* parameter to :meth:`get_value`.
Given *field_name*, convert it to an object to be formatted.
Auto-numbering of *field_name* returned from :meth:`parse` is done by
:meth:`vformat` before calling this method. Returns a tuple (obj, used_key).
Comment thread
dg-pb marked this conversation as resolved.
The default version takes strings of the form defined in :pep:`3101`,
such as "0[name]" or "label.title". *args* and *kwargs* are as passed in to
:meth:`vformat`. The return value *used_key* has the same meaning
as the *key* parameter to :meth:`get_value`.

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

Expand Down

Back | FazBrowse Home | New Git URL