-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codetopic-join-v-unionUsing join vs. using unionsUsing join vs. using unionstopic-type-narrowingConditional type narrowing / binderConditional type narrowing / bindertopic-union-types
Description
Bug Report
To Reproduce
x = object()
if isinstance(x, (int, str)):
reveal_type(x) # Union[int, str]
if isinstance(x, int):
pass
reveal_type(x) # objectExpected Behavior
both types revealed as Union[int, str]
Actual Behavior
object from second type
Your Environment
- Mypy version used: latest master (0.820+dev.72ac2cee910ca61bfdf449217328b6d10b45d378)
- Mypy command-line flags: none
- Mypy configuration options from
mypy.ini(and other config files): none - Python version used: 3.7.3
- Operating system and version: debian 10 based linux distro
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codetopic-join-v-unionUsing join vs. using unionsUsing join vs. using unionstopic-type-narrowingConditional type narrowing / binderConditional type narrowing / bindertopic-union-types