Serhiy Storchaka <[email protected]> added the comment:
"{" has special meaning only when it is used in the special forms "\{[0-9]+\}",
"\{,[0-9]+\}" or "\{[0-9]+,[0-9]+\}". In all other cases it means literal "{".
I once tried to emit warnings when non-escaped "{" is used in literal meaning,
but it did break a lot of code (for example in string.Template). I decided that
it is too destructive change.
Now, we can emit a warning (and later error) if there are extra spaces. It is a
breaking change, but I hope it will not break much user code. But which cases
should be recognized as error and which silently accepted with literal meaning
of "{"? Should we only handle spaces after comma, or before and after digits?
Should we check spaces only or tabs and newlines and other whitespaces?
What about the verbose mode? Currently the third-party regex module ignores
whitespace and comments in the verbose mode in more places than the re module.
The re module consider some sequences atomic and does not allow whitespaces
inside them even in the verbose mode, for simplicity and performance.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue42469>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com