Skip to content

Spurious E231 for nested format substitutions #1241

Open
@anntzer

Description

@anntzer

For

x = 1
digits = 1
print(f"{x:0.{digits:d}f}")  # admittedly the :d is not needed in this minimal repro, but still valid.

pycodestyle 2.11.1 spuriously complains about a missing whitespace after the second colon in the f-string:

test.py:3:21: E231 missing whitespace after ':'

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