Ben Wolfson wrote:
You can't have an internal replacement field in this part of the replacement field, so '{' can always safely be assumed to be Just a Brace and not the start of a replacement field, regardless of whether it's doubled,
I'm worried that the rules in this area are getting too complicated for a human to follow. If braces are allowed as plain data between square brackets and/or vice versa, it's going to be a confusing mess to read, and there will always be some doubt in the programmer's mind as to whether they have to be escaped somehow or not. I'm inclined to think that any such difficult cases should simply be disallowed. If the docs say an identifier is required someplace, the implementation should adhere strictly to that. It's not *that* hard to parse an indentifier properly, and IMO any use case that requires putting arbitrary characters into an item selector is abusing the format mechanism and should be redesigned to work some other way. -- Greg _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com