-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
bugmypy got something wrongmypy got something wrongpriority-0-hightopic-inheritanceInheritance and incompatible overridesInheritance and incompatible overridestopic-type-contextType context / bidirectional inferenceType context / bidirectional inferencetopic-usability
Description
In this example there is an unnecessary message about needing a type annotation:
from typing import List
class A:
x: List[str]
class B(A):
x = [] # Need type annotationHere we should we able to use the base class type for x as type context for the x initializer.
This is closely related to #3208.
natemcmaster, RJPercival, christianbundy and LeeeeT
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongpriority-0-hightopic-inheritanceInheritance and incompatible overridesInheritance and incompatible overridestopic-type-contextType context / bidirectional inferenceType context / bidirectional inferencetopic-usability