Skip to content

Formatter can delete comments between f-string expr and format spec #18672

Closed
@MeGaGiGaGon

Description

@MeGaGiGaGon

Summary

As the title says, any comments between the f-string expr and format spec can get deleted by the formatter if it gets collapsed to one line and there is a # in the format spec playground

f"{1
# test
:#}"

Formats to

f"{1:#}"

Version

playground

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingformatterRelated to the formatter

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions