File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -264,17 +264,15 @@ def is_same_type(
264264 a non-simplified union) but are semantically exchangeable in all contexts.
265265 """
266266 # First, use fast path for some common types. This is performance-critical.
267- if a is b :
268- return True
269- elif (
267+ if (
270268 type (a ) is Instance
271269 and type (b ) is Instance
272270 and a .type == b .type
273271 and len (a .args ) == len (b .args )
274272 and a .last_known_value is b .last_known_value
275273 ):
276274 return all (is_same_type (x , y ) for x , y in zip (a .args , b .args ))
277- elif a == b :
275+ elif isinstance ( a , TypeVarType ) and isinstance ( b , TypeVarType ) and a . id == b . id :
278276 return True
279277
280278 # Note that using ignore_promotions=True (default) makes types like int and int64
You can’t perform that action at this time.
0 commit comments