-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
false-positivemypy gave an error on correct codemypy gave an error on correct codepriority-1-normaltopic-typed-dicttopic-usability
Description
Consider the following code:
from mypy_extensions import TypedDict
class MovieBase(TypedDict):
name: str
year: int
class Movie(MovieBase, MovieBase):
based_on: strNotice that the Movie class inherits MovieBase twice.
mypy gives the following errors:
n.py:8: error: Cannot overwrite TypedDict field "name" while merging
n.py:8: error: Cannot overwrite TypedDict field "year" while merging
while there's no runtime error.
Note that if MovieBase was not a TypedDict, there would be a runtime TypeError: duplicate base class MovieBase
I think the right thing here would be to report duplicate base class.
mitar
Metadata
Metadata
Assignees
Labels
false-positivemypy gave an error on correct codemypy gave an error on correct codepriority-1-normaltopic-typed-dicttopic-usability