Skip to content

Rule proposal: in-empty-collection #16569

@naslundx

Description

@naslundx

Summary

After discussions in #15732 and #15729 an idea was proposed to add a rule for checking unnecessary membership test in empty collections.

This would reinstate the old behavior in rule PLR6201 to explicitly check for things like if 1 in [] or if 'a' not in ''.

Should ruff include it?

Example implementation is here: #16480

Metadata

Metadata

Assignees

No one assigned

    Labels

    ruleImplementing 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