Skip to content

F-string formatting: Invalid syntax for format-spec with double quotes when targeting pre Python 3.12 #14608

@MichaReiser

Description

@MichaReiser
f'{x:a{y=:{z:hy "user"}}} \'\'\''

Gets formatted to

f"{x:a{y=:{z:hy "user"}}} '''"

when preview mode is enabled and targeting a version < Python 3.12

This is related to #14493

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingformatterRelated to the formatterpreviewRelated to preview mode features

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions