[issue32376] Unusable syntax error reported when Python keyword in a f-string

Dmitry sky report at bugs.python.org
Tue Dec 19 10:59:56 EST 2017


New submission from Dmitry sky <d.v.selitsky at gmail.com>:

def get_search_url(from_, to):
    return f"http://thesite.com/Search?SO0={from_}&SD0={to}&SD1={from}&NA=false"
#   pls note `from_` vs `from`                                  ^^^^^^


$ python fstring.py
  File "<fstring>", line 1
    (from)
        ^
SyntaxError: invalid syntax


Should report real line #.

----------
components: Interpreter Core
files: fstring.py
messages: 308657
nosy: Dmitry sky
priority: normal
severity: normal
status: open
title: Unusable syntax error reported when Python keyword in a f-string
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file47338/fstring.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32376>
_______________________________________


More information about the Python-bugs-list mailing list