Skip to content

False positive for F841 Unused variable when using assignment expressions #843

Description

@jcarlosroldan

This example from the PEP 572 incorrectly reports the total variable as unused:

def cumulative_sum(values):
    total = 0
    return [total := total + v for v in values]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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