Parser icon indicating copy to clipboard operation
Parser copied to clipboard

Using strings inside f-string

Open mtshiba opened this issue 1 year ago • 3 comments

From: https://github.com/mtshiba/pylyzer/issues/115

Starting with Python 3.12, the use of strings within f-strings is permitted.

Reference

However, the current parser implementation does not seem to allow the use of same quoting type strings within f-strings.

f"{"hello"}"

results in the following parsing error:

invalid syntax. Got unexpected token 'hello' at row 1 col 5

mtshiba avatar Dec 03 '24 04:12 mtshiba

Yes, we are not following up this feature yet, sorry. RustPython is considering to move on Ruff's python parser. If it is successful, I doubt RustPython team will put effort to this repository anymore.

youknowone avatar Dec 11 '24 08:12 youknowone

This issue also affects a project I'm working on. If the decision is to move to the ruff python parser then it would be nice to get some guidance on migration, if anyone has time to support with that.

Peter554 avatar Dec 24 '24 07:12 Peter554

Ah, another f-string that is failing is this

f'{' f'}'

I guess I just don't bother with test_fstring for now.

hbina avatar Feb 09 '25 11:02 hbina