[issue41967] Handle annotations in the parser to avoid the need for roundtrip

Eric V. Smith report at bugs.python.org
Wed Oct 7 20:19:06 EDT 2020


Eric V. Smith <eric at trueblade.com> added the comment:

It's true that f-string expressions can't contain newlines.

f-strings are definitely easier, because the tokenizer has already tokenized the string from the input, so I'm just remembering pointers inside the tokenized string.

I was thinking that maybe you could get access to the buffer that the tokenizer is using. I'd have to check to see if it's guaranteed to all be in one contiguous buffer or not.

Anyway, since the problem is at least superficially similar (at least to me!), I thought I'd mention how f-strings handle it. There might not be anything of value here to take away.

----------

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


More information about the Python-bugs-list mailing list