New submission from Nathan Binkert: Autonumbering with string.format does not work as it does in str.format:
>>> '{}'.format(1) '1' >>> import string >>> string.Formatter().format('{}', 1) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/nate/src/python3/Lib/string.py", line 164, in format return self.vformat(format_string, args, kwargs) File "/Users/nate/src/python3/Lib/string.py", line 168, in vformat result = self._vformat(format_string, args, kwargs, used_args, 2) File "/Users/nate/src/python3/Lib/string.py", line 190, in _vformat obj, arg_used = self.get_field(field_name, args, kwargs) File "/Users/nate/src/python3/Lib/string.py", line 253, in get_field obj = self.get_value(first, args, kwargs) File "/Users/nate/src/python3/Lib/string.py", line 210, in get_value return kwargs[key] ---------- components: Library (Lib) messages: 182916 nosy: binkert priority: normal severity: normal status: open title: Autonumbering in string.Formatter doesn't work versions: Python 2.7, Python 3.3 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue17292> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com