You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems Mypy's method TypeChecker.check_compatibility for checking multiple inheritance compatibility does not consider that callable objects can be subtypes of usual functions, but method TypeChecker.check_method_override_for_base_with_name does so for single inheritance.
For the following example, Mypy reports:
Definition of "f" in base class "A1" is incompatible with definition in base class "A2" [misc]
Definition of "f" in base class "A2" is incompatible with definition in base class "A1" [misc]
…ible subtypes of usual functions (Fixespython#14852).
The solution is inspired by the `visit_instance` method of `SubtypeVisitor`. The `testMultipleInheritanceOverridingOfFunctionsWithCallableInstances` tests the new functionality for decorated and non-decorated functions and callable objects.
…ons (#14855)
Let the multiple inheritance checks consider callable objects as
possible subtypes of usual functions (Fixes#14852).
The solution is inspired by the `visit_instance` method of
`SubtypeVisitor`. The
`testMultipleInheritanceOverridingOfFunctionsWithCallableInstances`
tests the new functionality for decorated and non-decorated functions
and callable objects.
…ons (#14855)
Let the multiple inheritance checks consider callable objects as
possible subtypes of usual functions (Fixes#14852).
The solution is inspired by the `visit_instance` method of
`SubtypeVisitor`. The
`testMultipleInheritanceOverridingOfFunctionsWithCallableInstances`
tests the new functionality for decorated and non-decorated functions
and callable objects.
It seems Mypy's method
TypeChecker.check_compatibility
for checking multiple inheritance compatibility does not consider that callable objects can be subtypes of usual functions, but methodTypeChecker.check_method_override_for_base_with_name
does so for single inheritance.For the following example, Mypy reports:
The text was updated successfully, but these errors were encountered: