@@ -58,8 +58,8 @@ class A(Base1, metaclass=metaclass):
58
58
a1 = A [1 ]()
59
59
a2 = A [2 ]()
60
60
61
- assert type (a1 ) == A [1 ]
62
- assert type (a2 ) == A [2 ]
61
+ assert type (a1 ) is A [1 ]
62
+ assert type (a2 ) is A [2 ]
63
63
assert isinstance (a1 , A [1 ])
64
64
assert not isinstance (a1 , A [2 ])
65
65
assert issubclass (type (a1 ), A )
@@ -157,11 +157,11 @@ def __init__(self, v, w, x, y, z):
157
157
assert not issubclass (E [1 ], D [1 , 2 ])
158
158
assert not issubclass (E [1 ], D [2 ])
159
159
160
- assert type (A (1 )) == A
161
- assert type (B (1 , 2 )) == B [int , int ]
162
- assert type (C (1 , 2 , 3 )) == C
163
- assert type (D (1 , 2 , 3 , 4 )) == D [int , int , int , int ]
164
- assert type (E (1 , 2 , 3 , 4 , 5 )) == E [int , int , int , int , int ]
160
+ assert type (A (1 )) is A
161
+ assert type (B (1 , 2 )) is B [int , int ]
162
+ assert type (C (1 , 2 , 3 )) is C
163
+ assert type (D (1 , 2 , 3 , 4 )) is D [int , int , int , int ]
164
+ assert type (E (1 , 2 , 3 , 4 , 5 )) is E [int , int , int , int , int ]
165
165
166
166
167
167
def test_parametric_covariance ():
@@ -249,7 +249,7 @@ def __init__(self, x, *, y=3):
249
249
250
250
assert A [float ].parametric
251
251
assert A [float ].concrete
252
- assert A [float ].type_parameter == float
252
+ assert A [float ].type_parameter is float
253
253
254
254
a1 = A [float ](5.0 )
255
255
a2 = A (5.0 )
@@ -259,9 +259,9 @@ def __init__(self, x, *, y=3):
259
259
assert a1 .y == 3
260
260
assert a2 .y == 3
261
261
262
- assert type_parameter (a1 ) == float
263
- assert type_parameter (a2 ) == float
264
- assert type (a1 ) == type (a2 )
262
+ assert type_parameter (a1 ) is float
263
+ assert type_parameter (a2 ) is float
264
+ assert type (a1 ) is type (a2 )
265
265
assert type (a1 ).__name__ == type (a2 ).__name__ == "A[float]"
266
266
267
267
@@ -547,7 +547,7 @@ def test_val():
547
547
(Val [3 , 4 ], Val ((3 , 4 ))),
548
548
(Val [(3 , 4 )], Val ((3 , 4 ))),
549
549
]:
550
- assert type (v ) == T
550
+ assert type (v ) is T
551
551
assert T () == v
552
552
553
553
# Test all checks for numbers of arguments and the like.
0 commit comments