Re: [Python-Dev] The syntax of replacement fields in format strings

2017-10-31 Thread Guido van Rossum
I'd say let sleeping dogs lie. On Tue, Oct 31, 2017 at 3:52 AM, Eric V. Smith wrote: > If I had it to do over again, I’d implement it more strictly and only > allow chars that are valid in identifiers. > > But see https://bugs.python.org/issue31907 for a case that is currently > valid and would

Re: [Python-Dev] The syntax of replacement fields in format strings

2017-10-31 Thread Eric V. Smith
If I had it to do over again, I’d implement it more strictly and only allow chars that are valid in identifiers. But see https://bugs.python.org/issue31907 for a case that is currently valid and would break if we changed how it worked. I’m not sure it’s worth the churn of deprecating this and

[Python-Dev] The syntax of replacement fields in format strings

2017-10-31 Thread Serhiy Storchaka
According to the specification of format string syntax [1] (I meant str.format(), not f-strings), both argument name and attribute name must be Python identifiers. But the current implementation is more lenient and allow arbitrary sequences of characters while they don't contain '.', '[', ']',