You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mypy 1.12.0
Incompatible default for argument "a_type" (default has type "type[memoryview[Any]]", argument has type "type[memoryview[int]] | type[str]")
Your Environment
github action ubuntu various , python various
Mypy command-line flags:
-no flags
Mypy configuration options from mypy.ini (and other config files):
None
Python version used: via github actions
3.8, 3.9, 3.10, 3.11, 3.12 and 3.13
while
"""
a_type: type[memoryview] = memoryview
""""
Works ok!
The text was updated successfully, but these errors were encountered:
Union type context wasn's handled previously, and it triggered false
positives, but apparently only if a type object had type var defaults.
Fixes#17942.
Union type context wasn't handled previously, and it triggered false
positives, but apparently only if a type object had type var defaults.
Fixes#17942.
Union type context wasn't handled previously, and it triggered false
positives, but apparently only if a type object had type var defaults.
Fixespython#17942.
Bug Report
new to 1.12.0
incorrect error message on union of two type one being memoryview
Complete file checked:
"""
a_type: type[memoryview] | type[str] = memoryview
"""
mypy 1.11.2 no error
mypy 1.12.0
Incompatible default for argument "a_type" (default has type "type[memoryview[Any]]", argument has type "type[memoryview[int]] | type[str]")
Your Environment
github action ubuntu various , python various
-no flags
mypy.ini
(and other config files):3.8, 3.9, 3.10, 3.11, 3.12 and 3.13
while
"""
a_type: type[memoryview] = memoryview
""""
Works ok!
The text was updated successfully, but these errors were encountered: