-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugmypy got something wrongmypy got something wrongpriority-0-hightopic-pluginsThe plugin API and ideas for new pluginsThe plugin API and ideas for new pluginstopic-typed-dicttopic-union-types
Description
Some plugin hooks (in particular for TypedDicts) are not called if the underlying "base" type is a union. For example:
from typing import Union
from mypy_extensions import TypedDict
class TDA(TypedDict):
a: int
class TDB(TypedDict):
a: int
td: Union[TDA, TDB]
reveal_type(td['a']) # Revealed type is 'builtins.object*'
reveal_type(td.pop('a')) # Revealed type is 'builtins.object'
# Argument 1 to "pop" of "TypedDict" has incompatible type "str"; expected "NoReturn"This affects both "builtin" plugins and user defined plugins.
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongpriority-0-hightopic-pluginsThe plugin API and ideas for new pluginsThe plugin API and ideas for new pluginstopic-typed-dicttopic-union-types