[issue45704] string.Formatter.parse does not handle auto-numbered positional fields

Eric V. Smith report at bugs.python.org
Thu Nov 4 18:32:38 EDT 2021


Eric V. Smith <eric at trueblade.com> added the comment:

The more I think about this, the more I think it's not .parse's job to fill in the field numbers, it's the job of whoever is calling it.

Just as it's not .parse's job to give you an error if you switch back and forth between numbered and un-numbered fields.

It's literally just telling you what's in the string as it breaks it apart, not assigning any further meaning to the parts. I guess I should have called it .lex, not .parse.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45704>
_______________________________________


More information about the Python-bugs-list mailing list