Skip to content

Commit 623a2ac

Browse files
committed
Fixed type errors.
1 parent 285b48d commit 623a2ac

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

mypy/nodes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,9 +1292,9 @@ def accept(self, visitor: NodeVisitor[T]) -> T:
12921292
return visitor.visit_type_application(self)
12931293

12941294

1295-
INVARIANT = 0
1296-
COVARIANT = 1
1297-
CONTRAVARIANT = 2
1295+
INVARIANT = 0 # type: int
1296+
COVARIANT = 1 # type: int
1297+
CONTRAVARIANT = 2 # type: int
12981298

12991299
class TypeVarExpr(SymbolNode):
13001300
"""Type variable expression TypeVar(...)."""

mypy/semanal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def find_type_variables_in_type(
276276
277277
This effectively does partial name binding, results of which are mostly thrown away.
278278
"""
279-
result = [] # type: List[Tuple[str, List[Type]]]
279+
result = [] # type: List[Tuple[str, TypeVarExpr]]
280280
if isinstance(type, UnboundType):
281281
name = type.name
282282
node = self.lookup_qualified(name, type)

mypy/subtypes.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ def is_equivalent(a: Type, b: Type,
6060

6161
class SubtypeVisitor(TypeVisitor[bool]):
6262

63-
check_type_parameter = None # Callable[[Type, Type, int], bool]
64-
6563
def __init__(self, right: Type,
6664
type_parameter_checker: TypeParameterChecker) -> None:
6765
self.right = right

mypy/typefixture.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class TypeFixture:
1919
The members are initialized to contain various type-related values.
2020
"""
2121

22-
def __init__(self, variance: int=COVARIANT):
22+
def __init__(self, variance: int=COVARIANT) -> None:
2323
# The 'object' class
2424
self.oi = self.make_type_info('builtins.object') # class object
2525
self.o = Instance(self.oi, []) # object
@@ -197,7 +197,7 @@ def make_type_info(self, name: str,
197197
variance = variances[id-1]
198198
else:
199199
variance = COVARIANT
200-
v.append(TypeVarDef(n, id, None, self.oi, variance=variance))
200+
v.append(TypeVarDef(n, id, None, self.o, variance=variance))
201201
class_def.type_vars = v
202202

203203
info = TypeInfo(SymbolTable(), class_def)

0 commit comments

Comments
 (0)