Skip to content

False positive E202 and E251 inside f-string (Python 3.12) #1201

@AndrewUshakov

Description

@AndrewUshakov

Hi!

For the code below:

a = 10
print(f'{a = }')

the pycodestyle.py version 2.11.0 generates 3 false positive errors:

tst.py:2:11: E251 unexpected spaces around keyword / parameter equals
tst.py:2:13: E202 whitespace before '}'
tst.py:2:13: E251 unexpected spaces around keyword / parameter equals

P.S. Python 3.12.0 (tags/v3.12.0:0fb18b0, Oct 2 2023, 13:03:39) [MSC v.1935 64 bit (AMD64)] on win32

Thank you in advance.

Andrew

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions