Skip to content

C419 introduce invalid python since v0.5.3 #12420

@UnknownPlatypus

Description

@UnknownPlatypus

HI,

Since v0.5.3 and the changes made in #12364, ruff autofix introduced breakage in my code.
The following was autofixed from this:

timedelta_list = [dt.timedelta(days=2),dt.timedelta(days=1)]
res = sum(
    [
        delta
        for delta in timedelta_list
        if delta
    ],
    dt.timedelta(),
).total_seconds()

to this

timedelta_list = [dt.timedelta(days=2),dt.timedelta(days=1)]
res = sum(
    delta
        for delta in timedelta_list
        if delta,
    dt.timedelta(),
).total_seconds()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixesRelated to suggested fixes for violations

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions