-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Labels
bugmypy got something wrongmypy got something wrongpriority-1-normaltopic-reveal-typereveal_type() and reveal_locals()reveal_type() and reveal_locals()
Description
The first filter
call below generates an error when using --py2
, but the same call without reveal_type(...)
is fine:
from typing import Any, List
a = 0 # type: Any
x = filter(None, reveal_type(a)) # type: List[str] # Error
x2 = filter(None, a) # type: List[str] # No error
The error message is Incompatible types in assignment (expression has type "Tuple[<nothing>, ...]", variable has type "List[str]")
.
reveal_type
should have no effect on inferred types, since it's often used to diagnose issues with type inference.
strboul
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongpriority-1-normaltopic-reveal-typereveal_type() and reveal_locals()reveal_type() and reveal_locals()