Skip to content

SIM910 only applies to dictionary literals #8760

@ThiefMaster

Description

@ThiefMaster

This doesn't trigger a violation even when using the example from the docs.

ages = {"Tom": 23, "Maria": 23, "Dog": 11}
age = ages.get("Cat", None)  # None
$ ruff --isolated --select SIM910 --preview --no-cache rufftest/ruff_sample.py
(no output)

(ruff 0.1.6)

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