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 Arfrever
Recipients Arfrever, eric.smith
Date 2015-09-21.19:57:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1442865421.08.0.715266193748.issue25206@psf.upfronthosting.co.za>
In-reply-to
Content
"""
For example, this code:

 f'abc{expr1:spec1}{expr2!r:spec2}def{expr3:!s}ghi'

Might be be evaluated as:

 'abc' + format(expr1, spec1) + format(repr(expr2)) + 'def' + format(str(expr3)) + 'ghi'
"""

format(repr(expr2)) should be format(repr(expr2), spec2)



"""
>>> f'x={x'
  File "<stdin>", line 1
SyntaxError: missing '}' in format string expression
"""

Actually implemented exception message is:
SyntaxError: f-string: expecting '}'



"""
>>> f'x={!x}'
  File "<fstring>", line 1
    !x
    ^
SyntaxError: invalid syntax
"""

Actually implemented exception message is:
SyntaxError: f-string: invalid conversion character: expected 's', 'r', or 'a'
History
Date User Action Args
2015-09-21 19:57:01Arfreversetrecipients: + Arfrever, eric.smith
2015-09-21 19:57:01Arfreversetmessageid: <1442865421.08.0.715266193748.issue25206@psf.upfronthosting.co.za>
2015-09-21 19:57:01Arfreverlinkissue25206 messages
2015-09-21 19:57:00Arfrevercreate