-
-
Notifications
You must be signed in to change notification settings - Fork 31.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NULL in lexical analysis of f-string #116881
Comments
Could you point to where in the documentation you're referring? It seems to me that And is there any practical problem this causes? |
are from string literals In the The full grammar has the following, without the unneeded .
where FSTRING_MIDDLE is a token. The repetition
I am making a PR. |
In Lexical Analysis f-strings section, NULL in the description of 'literal character' means '\0'. In the format_spec grammar production, it is wrong with that meaning and redundant if instead interpreted as <nothing>. Remove it there.
In Lexical Analysis f-strings section, NULL in the description of 'literal character' means '\0'. In the format_spec grammar production, it is wrong with that meaning and redundant if instead interpreted as <nothing>. Remove it there.
…-116885) In Lexical Analysis f-strings section, NULL in the description of 'literal character' means '\0'. In the format_spec grammar production, it is wrong with that meaning and redundant if instead interpreted as <nothing>. Remove it there. (cherry picked from commit 4e45c6c) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
…-116885) In Lexical Analysis f-strings section, NULL in the description of 'literal character' means '\0'. In the format_spec grammar production, it is wrong with that meaning and redundant if instead interpreted as <nothing>. Remove it there. (cherry picked from commit 4e45c6c) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Thanks for the PR, and for pinging me! |
…) (#116951) In Lexical Analysis f-strings section, NULL in the description of 'literal character' means '\0'. In the format_spec grammar production, it is wrong with that meaning and redundant if instead interpreted as <nothing>. Remove it there. (cherry picked from commit 4e45c6c) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
…) (#116952) In Lexical Analysis f-strings section, NULL in the description of 'literal character' means '\0'. In the format_spec grammar production, it is wrong with that meaning and redundant if instead interpreted as <nothing>. Remove it there. (cherry picked from commit 4e45c6c) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
…-116885) In Lexical Analysis f-strings section, NULL in the description of 'literal character' means '\0'. In the format_spec grammar production, it is wrong with that meaning and redundant if instead interpreted as <nothing>. Remove it there.
…-116885) In Lexical Analysis f-strings section, NULL in the description of 'literal character' means '\0'. In the format_spec grammar production, it is wrong with that meaning and redundant if instead interpreted as <nothing>. Remove it there.
…-116885) In Lexical Analysis f-strings section, NULL in the description of 'literal character' means '\0'. In the format_spec grammar production, it is wrong with that meaning and redundant if instead interpreted as <nothing>. Remove it there.
Documentation
This is somewhat related to #116580. There are two references to NULL in the description of f-strings that don't have a clear meaning.
In both cases (but especially
literal_char
), it could refer to U+0000, but I'm unaware that a null character is allowed anywhere in Python source. At least, my attempt to inject one failed:For
format_spec
, it could refer to an empty specification (f'{x:}'
), but(literal_char | replacement_field)*
would cover that just as well.Linked PRs
The text was updated successfully, but these errors were encountered: