-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Labels
F: stringsRelated to our handling of stringsRelated to our handling of stringsT: styleWhat do we want Blackened code to look like?What do we want Blackened code to look like?
Description
I had this idea while reading #4522. This probably shouldn't block hex_codes_in_unicode_sequences
from being stabilized since it is an edge case, but would be nice to have.
playground link Currently, f"{'\xFF'}"
does not get formatted. It should be formattable to f"{'\xff'}"
.
Note that any changes here have to be careful of f-string debug statements. This formatting would not have any effect since \xXX
is resolved in the string literal before the formatting output happens
>>> f"{'\xFF'=}"
"'ÿ'='ÿ'"
>>> f"{'\xff'=}"
"'ÿ'='ÿ'"
but if there is ever a situation where the formatting is applied when the escape isn't resolved, then the behavior would change observably.
Metadata
Metadata
Assignees
Labels
F: stringsRelated to our handling of stringsRelated to our handling of stringsT: styleWhat do we want Blackened code to look like?What do we want Blackened code to look like?