[issue12014] str.format parses replacement field incorrectly

Petri Lehtinen report at bugs.python.org
Wed Nov 30 08:53:10 CET 2011


Petri Lehtinen <petri at digip.org> added the comment:

> I just noticed that the patch labelled strformat-as-document is
> actually the same as the other one, owing to my incompetence.

All three patches look different to me.

> Anyway, as far as I can tell the patches would have to be reworked
> in the light of recent changes anyway. I am willing to do this if
> there's actually interest. Otherwise, is there anything else I can
> do here? Is it necessary to write a PEP or take this to python-ideas
> or something?

There's still interest, at least from me :)

In my opinion we should have the documented behavior (integer or identifier as field_name), AND braces should be disallowed inside the format string, with the exception of one level of nesting in the format_spec part.

This should probably be taken to python-dev once more, as the previous discussion didn't reach consesus, except that the current approach is bad and something needs to be done.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12014>
_______________________________________


More information about the Python-bugs-list mailing list