-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
previewRelated to preview mode featuresRelated to preview mode featuresruleImplementing or modifying a lint ruleImplementing or modifying a lint rule
Description
Summary
E.g. use of Sequence[int] is not flagged.
See example below (command I've used is ruff check test.py --target-version py38 --select=FA102)
Ruff playground - https://play.ruff.rs/b295c8a4-4295-4a5a-8a2d-e99699814822
from collections.abc import Sequence
# Not reported by Ruff, but results in runtime error:
# TypeError: 'ABCMeta' object is not subscriptable
def test() -> Sequence[int]:
return [1, 2, 3]
# FA102 Missing `from __future__ import annotations`, but uses PEP 585 collection
def test2() -> list[int]:
return [1, 2, 3]Version
ruff 0.13.1
Metadata
Metadata
Assignees
Labels
previewRelated to preview mode featuresRelated to preview mode featuresruleImplementing or modifying a lint ruleImplementing or modifying a lint rule