-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
formatterRelated to the formatterRelated to the formatterpreviewRelated to preview mode featuresRelated to preview mode features
Milestone
Description
This issue is to kickoff a discussion around the formatting for f-strings. With PEP 701, f-strings changes the behavior with what kind of syntax is allowed:
- Comments inside f-strings:
# comment 0
f"""
{ # comment 1
# comment 2
foo # comment 3
# comment 4
}""" # comment 5
- F-strings can be nested within f-strings
f"first {f"second {f"third ..."} second"} first"
- Quotes can be repeated inside nested f-strings (for both strings and f-strings)
f"double quotes {"same quotes in strings" + f"same quotes in f-strings"}"
This means that the formatter needs to be updated to possibly handle f-strings on it's own. Currently, it's handled as part of string formatting.
Metadata
Metadata
Assignees
Labels
formatterRelated to the formatterRelated to the formatterpreviewRelated to preview mode featuresRelated to preview mode features