]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Removed used_args param from string.Formatter.get_field. It was left in by mistake...
authorEric Smith <eric@trueblade.com>
Sun, 2 Sep 2007 15:33:26 +0000 (15:33 +0000)
committerEric Smith <eric@trueblade.com>
Sun, 2 Sep 2007 15:33:26 +0000 (15:33 +0000)
Doc/library/string.rst
Lib/string.py

index 7810e46dec10d8f83cf9cacf5b9c3a819a38a6b6..b0061b753836d474ca335fd8425d0ef8f07e9938 100644 (file)
@@ -125,7 +125,7 @@ formatting behaviors using the same implementation as the built-in
       field, then the values of *field_name*, *format_spec* and *conversion*
       will be ``None``.
 
-   .. method:: get_field(field_name, args, kwargs, used_args)
+   .. 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
index ff21eb1944d8cfaba0c402bdff8f5a288eaed5b7..9b00a62e88b33ff9e18aef482ecf7c1d9b7e1fc1 100644 (file)
@@ -217,7 +217,7 @@ class Formatter:
 
                 # given the field_name, find the object it references
                 #  and the argument it came from
-                obj, arg_used = self.get_field(field_name, args, kwargs, used_args)
+                obj, arg_used = self.get_field(field_name, args, kwargs)
                 used_args.add(arg_used)
 
                 # do any conversion on the resulting object
@@ -272,11 +272,9 @@ class Formatter:
     #                 or "lookup[3]"
     #  used_args:    a set of which args have been used
     #  args, kwargs: as passed in to vformat
-    # also, mark it as used in 'used_args'
-    def get_field(self, field_name, args, kwargs, used_args):
+    def get_field(self, field_name, args, kwargs):
         first, rest = field_name._formatter_field_name_split()
 
-        used_args.add(first)
         obj = self.get_value(first, args, kwargs)
 
         # loop through the rest of the field_name, doing