This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients eric.smith, lukasz.langa, serhiy.storchaka
Date 2018-05-17.07:03:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1526540586.49.0.682650639539.issue33552@psf.upfronthosting.co.za>
In-reply-to
Content
There are problems with converting annotations containing f-strings into strings (from __future__ import annotations). For example f'''{"'"}''' is converted to f'{"\'"}', but the latter is a syntax error.

>>> from __future__ import annotations
>>> x: f'''{"'"}'''
>>> print(__annotations__['x'])
f'{"\'"}'
>>> x: f'{"\'"}'
  File "<stdin>", line 1
SyntaxError: f-string expression part cannot include a backslash

More complex examples:

f"""{"'''"}"""
f"""{"'" '"'}"""
f"""{"'''"}""" f'''{'"""'}'''
History
Date User Action Args
2018-05-17 07:03:06serhiy.storchakasetrecipients: + serhiy.storchaka, eric.smith, lukasz.langa
2018-05-17 07:03:06serhiy.storchakasetmessageid: <1526540586.49.0.682650639539.issue33552@psf.upfronthosting.co.za>
2018-05-17 07:03:06serhiy.storchakalinkissue33552 messages
2018-05-17 07:03:06serhiy.storchakacreate