From d35610d195afb067a29f798a9fbf72d9f898321b Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Sun, 8 Jan 2023 18:53:34 +0000 Subject: [PATCH] [Minor bugfix]: `typing_extensions.Any` is a thing --- src/typeshed_stats/gather.py | 2 +- tests/conftest.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/typeshed_stats/gather.py b/src/typeshed_stats/gather.py index 13d6f159..a11a7088 100644 --- a/src/typeshed_stats/gather.py +++ b/src/typeshed_stats/gather.py @@ -110,7 +110,7 @@ def visit_Attribute(self, node: ast.Attribute) -> None: value = node.value if isinstance(value, ast.Name): match f"{value.id}.{node.attr}": - case "typing.Any": + case "typing.Any" | "typing_extensions.Any": self.analysis.Any_in_annotation = True case "_typeshed.Incomplete": self.analysis.Incomplete_in_annotation = True diff --git a/tests/conftest.py b/tests/conftest.py index afee326e..63847284 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -144,8 +144,8 @@ async def metaclass_classmethod2(mcls) -> typing.Any: ... class Bacon(dict[str, Any], list[Any], tuple[Any, ...]): ... class Ham(dict[str, Incomplete], list[Incomplete], tuple[Incomplete, ...]): ... - class SpammySpam(dict[str, list[Incomplete]], list[list[Any]]): ... - class Peanuts(Any): ... + class SpammySpam(dict[str, list[_typeshed.Incomplete]], list[list[typing.Any]]): ... + class Peanuts(typing_extensions.Any): ... class Cashews(Incomplete): ... class Peas(Any, Incomplete): ... """