Skip to content

E721 and memoryview #8483

@hauntsaninja

Description

@hauntsaninja
λ cat x.py
def f(t):
    if t == str:
        pass
    elif t == bytes:
        pass
    elif t == memoryview:
        pass
λ ruff check --select=E721 x.py
x.py:2:8: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
x.py:4:10: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
Found 2 errors.

ruff should complain about comparison with memoryview as well

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