Jack DeVries <jdevries3...@gmail.com> added the comment: mypy does not support __parameters__:
(venv) ➜ cpython git:(main) cat repro.py from typing import TypeVar T = TypeVar('T') (int | list[T]).__parameters__ (venv) ➜ cpython git:(main) mypy --version mypy 0.920+dev.cae5d3c8b5f14d0796914aa6a113473ca3ffc38e (venv) ➜ cpython git:(main) python --version Python 3.11.0a0 (venv) ➜ cpython git:(main) mypy repro.py repro.py:4: error: "types.Union" has no attribute "__parameters__" Found 1 error in 1 file (checked 1 source file) (venv) ➜ cpython git:(main) mypy also does not support __getitem__ (venv) ➜ cpython git:(main) cat repro.py from typing import TypeVar T = TypeVar('T') (int | list[T]).__getitem__ (venv) ➜ cpython git:(main) mypy --version ./mypy 0.920+dev.cae5d3c8b5f14d0796914aa6a113473ca3ffc38e (venv) ➜ cpython git:(main) python --version Python 3.11.0a0 (venv) ➜ cpython git:(main) mypy repro.py repro.py:4: error: Value of type "types.Union" is not indexable Found 1 error in 1 file (checked 1 source file) (venv) ➜ cpython git:(main) ---------- nosy: +jack__d _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44490> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com