Skip to content

redefined-while-unused (F811) - false negative on variable redeclaration #23802

@DetachHead

Description

@DetachHead

Summary

def foo(): ...
def foo(): ... # error

bar: int = 1
bar: int = 2 # no error

https://play.ruff.rs/6b9cbf95-6f20-49b8-bc54-42230fc95411

(specifically it's the type annotation that makes it a redeclaration)

Version

0.15.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    previewRelated to preview mode featuresruleImplementing or modifying a lint rule

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions