Skip to content

[RUF] [preview] RUF037 could support empty strings #18854

@MeGaGiGaGon

Description

@MeGaGiGaGon

Summary

unnecessary-empty-iterable-within-deque-call (RUF037) currently does not support empty strings. Based on my github searches, this is an uncommon but present pattern, so could be a potential improvement.
playground

from collections import deque

queue = deque("")  # No error
queue = deque(b"")  # No error

Search for "deque('')", 34 results link
Search for "deque(\"\")", 12 results link
Search for "deque(b\"\")", 2 results link
Search for "deque(b'')", 1 result link

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