mypy incorrectly marks a @staticmethod definition of an attribute A to be incompatible with A's signature in a parent class. #12569
Labels
bug
mypy got something wrong
topic-calls
Function calls, *args, **kwargs, defaults
topic-descriptors
Properties, class vs. instance attributes
Bug Report
When a class C defines an attribute a to be a union type with
Callable
as one of its types (a: Callable | ...
), mypy incorrectly marks a@staticmethod
definition of a in a child class that inherits from C to be incompatible with a's signature in C.Worth noting that the following code produces no errors:
but the following code does
Expected Behavior
No errors.
Actual Behavior
Environment
0.941
--strict
,--show-error-codes
,--show-error-context
mypy.ini
(and other config files):3.10.3
The text was updated successfully, but these errors were encountered: