-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
featuregood-first-issuepriority-1-normaltopic-error-reportingHow we report errorsHow we report errorstopic-inheritanceInheritance and incompatible overridesInheritance and incompatible overridestopic-usability
Description
An incompatible override gets reported on the first line of a method header, even though it would be better to point it at the line with an argument that is incompatible, when possible. Example:
class A:
def f(self, x: int, y: str, z: float) -> None: pass
class B(A):
def f( # Argument 3 incompatible with supertype "A" <-- reported here
self,
x: int,
y: str,
z: bool, # <-- would be better to report it here
) -> None:
pass
This would improve usability, especially for methods with many arguments on many lines. This would also make it cleaner to ignore these errors, as the location of the # type: ignore
comment would document which argument is incompatible (if there is one argument per line, which is a common convention).
Metadata
Metadata
Assignees
Labels
featuregood-first-issuepriority-1-normaltopic-error-reportingHow we report errorsHow we report errorstopic-inheritanceInheritance and incompatible overridesInheritance and incompatible overridestopic-usability