Eric V. Smith added the comment:

Yes, Jelle, you are correct in all 3 cases. Remember that the steps are to 
extract the string from the source code, decode backslash escapes, and only 
then treat it as an f-string.

For the first case, without the 'f' prefix:
'{ {1: 2\N{RIGHT CURLY BRACKET}[1]}' == '{ {1: 2}[1]}'

Then, applying the 'f':
f'{ {1: 2}[1]}' == '2'.

For the last 2, since they're syntax errors without the 'f', they're also 
syntax errors with the 'f'.

I'll have a new version, with tests for all of these cases, posted in the next 
few hours. You can leverage the tests.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24965>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to