Skip to content

Commit 80b9fcd

Browse files
committed
Revert last change
1 parent bd109f7 commit 80b9fcd

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

mypy/subtypes.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)