This might be a question for core but figured I would start with help first. I have a semi-working tokenizer and thanks to LibCST a nearly rock solid parser implemented.
In Python/tokenizer.c, fstrings are wrapped up as dumb ‘f"Hello {place}"’ string that are parsed somewhere else.
Rust in Python steps character by character over a fstring to create a mini-ast which makes me think cPython does the same but I haven’t been able to find where.
For the curious, my code base is at github under user devdave, project name rython4. The antispam filter won’t let me post more than two hrefs to a post so that’s why there isn’t a direct link.
NOTE the Python software foundation license txt file hasn’t been copied into the repository yet. Regardless, because I am almost directly translating from cPython’s code base to rust, it’s a PSF project.
I have the language reference open/pinned on my browser and unfortunately the lexical rules for fstrings is only a little helpful, the valuable discovery would be finding the C code that processes f"string" to something the PEG parser can consume.