Skip to content

STYLE: Lint for comprehensions that use the list/set/dict functions #18464

Closed
@mroeschke

Description

@mroeschke

xref #18383

Ideally comprehensions should follow the general pattern:

list(x for x in iterator) --> [x for x in iterator]
set(x for x in iterator) --> {x for x in iterator}
dict((x,x) for x in iterator) --> {x: x for x in iterator}

Adding a lint check for the prior pattern in ci/lint.sh would be great.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Code StyleCode style, linting, code_checks

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions