File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -2215,10 +2215,6 @@ def check_method_override_for_base_with_name(
22152215 # Will always fail to typecheck below, since we know the node is a method
22162216 original_type = NoneType ()
22172217
2218- if name == "__hash__" and isinstance (original_type , NoneType ):
2219- # Allow defining `__hash__` even if parent class was explicitly made unhashable
2220- return False
2221-
22222218 always_allow_covariant = False
22232219 if is_settable_property (defn ) and (
22242220 is_settable_property (original_node ) or isinstance (original_node , Var )
@@ -2242,6 +2238,10 @@ def check_method_override_for_base_with_name(
22422238 typ = get_proper_type (typ )
22432239 original_type = get_proper_type (original_type )
22442240
2241+ if name == "__hash__" and isinstance (original_type , NoneType ):
2242+ # Allow defining `__hash__` even if parent class was explicitly made unhashable
2243+ return False
2244+
22452245 if (
22462246 is_property (defn )
22472247 and isinstance (original_node , Var )
You can’t perform that action at this time.
0 commit comments