Однако, когда я читаю mypy ( v0.991) по следующему коду:
Код: Выделить всё
from typing import Union, Any
special_dict: Union[dict[int, Any], dict[str, Any]]
special_dict = {}
Код: Выделить всё
test_dict_nothing.py:6: error: Incompatible types in assignment (expression has type "Dict[, ]", variable has type "Union[Dict[int, Any], Dict[str, Any]]") [assignment]
Found 1 error in 1 file (checked 1 source file)
Подробнее здесь: https://stackoverflow.com/questions/751 ... empty-dict