Skip to content

False positive A003 when overriding threading.Event.set #5956

@jamesbraza

Description

@jamesbraza
from threading import Event

class MyEvent(Event):
    def set(self) -> None:
        super().set()
        print("My override")

Running ruff==0.0.279:

> ruff --isolated --select="A003" a.py
a.py:5:9: A003 Class attribute `set` is shadowing a Python builtin

This seems like a false positive, as one has to use the word set to override the Event parent class's method.

Should A003 be raised on method overrides?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions