File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -3242,7 +3242,6 @@ def __init__(
32423242 super ().__init__ (line , column )
32433243 self .value = value
32443244 self .fallback = fallback
3245- self ._hash = - 1 # Cached hash value
32463245
32473246 # NOTE: Enum types are always truthy by default, but this can be changed
32483247 # in subclasses, so we need to get the truthyness from the Enum
@@ -3272,13 +3271,11 @@ def accept(self, visitor: TypeVisitor[T]) -> T:
32723271 return visitor .visit_literal_type (self )
32733272
32743273 def __hash__ (self ) -> int :
3275- if self ._hash == - 1 :
3276- self ._hash = hash ((self .value , self .fallback ))
3277- return self ._hash
3274+ return hash (self .value )
32783275
32793276 def __eq__ (self , other : object ) -> bool :
32803277 if isinstance (other , LiteralType ):
3281- return self .fallback == other .fallback and self .value == other .value
3278+ return self .value == other .value and type ( self .value ) is type ( other .value )
32823279 else :
32833280 return NotImplemented
32843281
You can’t perform that action at this time.
0 commit comments