Skip to content

f-string colon nesting breaks indentation #132

@ERRORxCAT

Description

@ERRORxCAT

Before the line break:

a = "1'2'3'4" #It can be ignored.

s = f"a = {a.split("'")}"

if True:|

Expected:

a = "1'2'3'4"

s = f"a = {a.split("'")}"

if True:
	|

Actual:

a = "1'2'3'4"

s = f"a = {a.split("'")}"

if True:
|

If you comment out this line, or switch the double quotes to single quotes and use escape characters, the issue does not occur:

a = "1'2'3'4"

#s = f"a = {a.split("'")}"
s = f"a = {a.split('\'')}"

if True:
	|

Minimal reproduction:

f"{"'"}"

if True:
|

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions