We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3b2c5f1 commit ec9542aCopy full SHA for ec9542a
mypy/types.py
@@ -543,7 +543,7 @@ class TypeVarId:
543
# function type variables.
544
545
# Metavariables are allocated unique ids starting from 1.
546
- raw_id: int
+ raw_id: Final[int]
547
548
# Level of the variable in type inference. Currently either 0 for
549
# declared types, or 1 for type inference metavariables.
@@ -586,7 +586,7 @@ def __ne__(self, other: object) -> bool:
586
return not (self == other)
587
588
def __hash__(self) -> int:
589
- return hash((self.raw_id, self.meta_level, self.namespace))
+ return self.raw_id ^ (self.meta_level << 8) ^ hash(self.namespace)
590
591
def is_meta_var(self) -> bool:
592
return self.meta_level > 0
0 commit comments