Currently I have a bunch of code that does this:
from typing import Dict
foo: Dict[str, str] = []
In Python 3.9+, it is preferable to use the built-in types (source):
foo: dict[str, str] = []
Is there a way to configure mypy
to raise an error/warning when my code uses Dict
instead of dict
?
2
Logged a mypy issue here to support this functionality: https://github.com/python/mypy/issues/17690