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
It works in some cases e.g. with cast() function but here with TypeVar it crashes.
Mypy accepts this file with no errors.
Traceback
File "mypy/stubgen.py", line 1858, in main
File "mypy/stubgen.py", line 1701, in generate_stubs
File "mypy/stubgen.py", line 1643, in generate_stub_from_ast
File "mypy/nodes.py", line 373, in accept
File "mypy/stubgen.py", line 643, in visit_mypy_file
File "mypy/traverser.py", line 114, in visit_mypy_file
File "mypy/nodes.py", line 1301, in accept
File "mypy/stubgen.py", line 1006, in visit_assignment_stmt
File "mypy/stubgen.py", line 1117, in process_typealias
File "mypy/nodes.py", line 1841, in accept
File "mypy/stubgen.py", line 362, in visit_call_expr
TypeError: str object expected; got None
To Reproduce
from __future__ importannotationsfromtypingimportTypeVarT=TypeVar("T", bound=str|None)
Your Environment
Mypy version used: 0.991
Mypy command-line flags: stubgen test.py
Mypy configuration options from mypy.ini (and other config files):
Python version used: 3.10.9
Operating system and version: macOS
The text was updated successfully, but these errors were encountered:
Crash Report
It works in some cases e.g. with
cast()
function but here withTypeVar
it crashes.Mypy accepts this file with no errors.
Traceback
To Reproduce
Your Environment
stubgen test.py
mypy.ini
(and other config files):The text was updated successfully, but these errors were encountered: