From a573d489f8c3eea23081222da5684fd0ce318c1b Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Thu, 10 Oct 2024 17:57:19 -0700 Subject: [PATCH] fix --- pyanalyze/annotations.py | 2 +- pyproject.toml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pyanalyze/annotations.py b/pyanalyze/annotations.py index ea8c3101..f71ab76d 100644 --- a/pyanalyze/annotations.py +++ b/pyanalyze/annotations.py @@ -784,7 +784,7 @@ def _type_from_subscripted_value( ctx.show_error("Optional[] takes only one argument") return AnyValue(AnySource.error) return unite_values(KnownValue(None), _type_from_value(members[0], ctx)) - elif root is type or root is type: + elif root is typing.Type or root is type: if len(members) != 1: ctx.show_error("Type[] takes only one argument") return AnyValue(AnySource.error) diff --git a/pyproject.toml b/pyproject.toml index df4ea726..583b6f19 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -76,3 +76,6 @@ ignore = [ "pyanalyze/test_*.py" = [ "UP", # Want to test old-style code ] +"pyanalyze/annotations.py" = [ + "UP006", # Need to refer to typing.Type +]