-
-
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-0-hightopic-typed-dict
Description
mypy isn't recognizing methods of TypedDict.
- mypy 0.521
- mypy_extensions 0.3.0
- typeshed 0.0.1
from mypy_extensions import TypedDict
D = TypedDict('D', {'a': int})
d = {'a': 4} # type: D
d.copy()
d.get('a')
d.clear()
d.setdefault('b', 7)
d.has_key('a')
d.items()
d.keys()
d.values()
d.iteritems()
d.iterkeys()
d.itervalues()
d.pop('b', None)
d.popitem()
d.update({'f': 11})
d.viewitems()
d.viewkeys()
d.viewvalues()
"""
$ mypy -2 example.py
example.py:7: error: "D" has no attribute "copy"
example.py:9: error: "D" has no attribute "clear"
example.py:10: error: "D" has no attribute "setdefault"
example.py:11: error: "D" has no attribute "has_key"
example.py:18: error: "D" has no attribute "pop"
example.py:19: error: "D" has no attribute "popitem"
example.py:20: error: "D" has no attribute "update"
example.py:21: error: "D" has no attribute "viewitems"
example.py:22: error: "D" has no attribute "viewkeys"
example.py:23: error: "D" has no attribute "viewvalues"
"""
mitar, abbeyj, mr-c, beaugunderson, wilk and 2 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-0-hightopic-typed-dict