PYI019 causes false positives on .py
files if you support Python <=3.10
#9761
Labels
rule
Implementing or modifying a lint rule
.py
files if you support Python <=3.10
#9761
I just tried enabling ruff's PYI rules on typeshed-stats, a hobby project of mine, and ran into a false positive with PYI019. I have the following class in the project:
PYI019 tells me off about this, saying:
But I still support Python 3.10 (
typing.Self
is new in Python 3.11), and don't havetyping_extensions
as a dependency, so this violation isn't actionable.(This isn't an issue for
.pyi
files, as type checkers thinktyping_extensions
is part of the stdlib due to some white lies we tell them in typeshed. That meansSelf
can always be imported fromtyping_extensions
in a.pyi
file, even if the stubs package doesn't explicitly declare a dependency ontyping_extensions
.)The text was updated successfully, but these errors were encountered: