Closed
Description
- Are you reporting a bug, or opening a feature request? Reporting a bug
- Please insert below the code you are checking with mypy,
or a mock-up repro if the source is private. We would appreciate if you try to simplify your case to a minimal repro.
from __future__ import annotations
from collections import defaultdict
squares: defaultdict[tuple, int] = defaultdict(lambda: 999999)
- What is the actual behaviour/output? MyPy tells me
"defaultdict" is not subscriptable, use "typing.DefaultDict" instead
- What is the behaviour/output you expect? MyPy ignores the subscript error (and recognises it as equivalent) because of
from __future__ import annotations
- What is the version of mypy and Python you are using? 0.740 on 3.8.0 (Ubuntu 18.04)
- No additional MyPy flags