-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codepriority-1-normaltopic-type-variablestopic-union-types
Description
from typing import *
def foo() -> Dict[str, Any]:
return {}
def bar() -> Union[Dict[str, Any], Dict[int, Any]]:
return {}
In foo
, {}
is inferred as Dict[str, Any]
.
In bar
, I get:
error: Incompatible return value type (got "Dict[<nothing>, <nothing>]", expected "Union[Dict[str, Any], Dict[int, Any]]")
ruuda, mtarvainen, maartenberg, antonio-antuan, jamescooke and 8 more
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codepriority-1-normaltopic-type-variablestopic-union-types