-
- Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
false-positivemypy gave an error on correct codemypy gave an error on correct codeneeds discussionpriority-0-hightopic-usability
Description
from typing import * class Test(object): x = 1 y = 2 for sub in [(1, 2)]: pass subs = {} # type: Dict[Tuple[int, int], Test] for sub in [Test()]: subs[(sub.x, sub.y)] = sub gives
/home/tabbott/foo.py:11: error: Incompatible types in assignment (expression has type "Test", variable has type "Tuple[int, int]") /home/tabbott/foo.py:12: error: Tuple[int, ...] has no attribute "x" /home/tabbott/foo.py:12: error: Tuple[int, ...] has no attribute "y" /home/tabbott/foo.py:12: error: Incompatible types in assignment Arguably this is not perfect code, but probably this shouldn't be a mypy error?
mcobzarenco, mkurnikov, cpburnz, iutlu, tasercake and 12 moresuzil
Metadata
Metadata
Assignees
Labels
false-positivemypy gave an error on correct codemypy gave an error on correct codeneeds discussionpriority-0-hightopic-usability