Skip to content

Commit 8330492

Browse files
committed
Use TYPE_VAR_LIKE_NAMES in stubgen
1 parent a97a406 commit 8330492

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

mypy/stubgen.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@
145145
DATACLASS_TRANSFORM_NAMES,
146146
OVERLOAD_NAMES,
147147
TPDICT_NAMES,
148+
TYPE_VAR_LIKE_NAMES,
148149
TYPED_NAMEDTUPLE_NAMES,
149150
AnyType,
150151
CallableType,
@@ -1090,14 +1091,7 @@ def is_alias_expression(self, expr: Expression, top_level: bool = True) -> bool:
10901091
or module alias.
10911092
"""
10921093
# Assignment of TypeVar(...) and other typevar-likes are passed through
1093-
if isinstance(expr, CallExpr) and self.get_fullname(expr.callee) in (
1094-
"typing.TypeVar",
1095-
"typing_extensions.TypeVar",
1096-
"typing.ParamSpec",
1097-
"typing_extensions.ParamSpec",
1098-
"typing.TypeVarTuple",
1099-
"typing_extensions.TypeVarTuple",
1100-
):
1094+
if isinstance(expr, CallExpr) and self.get_fullname(expr.callee) in TYPE_VAR_LIKE_NAMES:
11011095
return True
11021096
elif isinstance(expr, EllipsisExpr):
11031097
return not top_level

0 commit comments

Comments
 (0)