-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugmypy got something wrongmypy got something wrongtopic-pep-695Issues related to PEP 695 syntaxIssues related to PEP 695 syntaxtopic-type-aliasTypeAlias and other type alias issuesTypeAlias and other type alias issues
Description
Bug Report
If I declare a type with type T = dict
, then instantiate it with T()
, mypy does not error.
I spot-checked some other types like type T = set
, type T = int
etc, and mypy complains about these when called. Only type T = dict
seems to wrongly pass.
To Reproduce
type T = dict
x: T = T()
Expected Behavior
$ mypy t.py
t.py:2: error: "TypeAliasType" not callable [operator]
Found 1 error in 1 file (checked 1 source file)
Actual Behavior
$ mypy t.py
Success: no issues found in 1 source file
Your Environment
- Mypy version used:
mypy 1.17.1 (compiled: yes)
- Mypy command-line flags:
mypy
- Mypy configuration options from
mypy.ini
(and other config files): None - Python version used:
Python 3.13.5
brianschubert
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongtopic-pep-695Issues related to PEP 695 syntaxIssues related to PEP 695 syntaxtopic-type-aliasTypeAlias and other type alias issuesTypeAlias and other type alias issues