-
-
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 codegood-first-issuepriority-1-normaltopic-typed-dict
Description
Hi,
I believe there is a false positive related to empty TypedDicts with total=False.
Using --warn-unreachable:
from typing_extensions import TypedDict
class A(TypedDict, total=False):
...
class B(TypedDict, total=False):
x: int
a: A = {}
b: B = {}
if not a:
print('a is empty')
if not b:
print('b is empty') # error: Statement is unreachableUsing Python 3.7.4, tested with both mypy 0.740 and mypy master.
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codegood-first-issuepriority-1-normaltopic-typed-dict