Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9d4ba39

Browse files
committed
Removed used_args param from string.Formatter.get_field. It was left in by mistake from an earlier edit.
1 parent c79461b commit 9d4ba39

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

Doc/library/string.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ formatting behaviors using the same implementation as the built-in
125125
field, then the values of *field_name*, *format_spec* and *conversion*
126126
will be ``None``.
127127

128-
.. method:: get_field(field_name, args, kwargs, used_args)
128+
.. method:: get_field(field_name, args, kwargs)
129129

130130
Given *field_name* as returned by :meth:`parse` (see above), convert it to
131131
an object to be formatted. Returns a tuple (obj, used_key). The default

Lib/string.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def vformat(self, format_string, args, kwargs):
217217

218218
# given the field_name, find the object it references
219219
# and the argument it came from
220-
obj, arg_used = self.get_field(field_name, args, kwargs, used_args)
220+
obj, arg_used = self.get_field(field_name, args, kwargs)
221221
used_args.add(arg_used)
222222

223223
# do any conversion on the resulting object
@@ -272,11 +272,9 @@ def parse(self, format_string):
272272
# or "lookup[3]"
273273
# used_args: a set of which args have been used
274274
# args, kwargs: as passed in to vformat
275-
# also, mark it as used in 'used_args'
276-
def get_field(self, field_name, args, kwargs, used_args):
275+
def get_field(self, field_name, args, kwargs):
277276
first, rest = field_name._formatter_field_name_split()
278277

279-
used_args.add(first)
280278
obj = self.get_value(first, args, kwargs)
281279

282280
# loop through the rest of the field_name, doing

0 commit comments

Comments
 (0)