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
Exception has occurred: TypeError (note: full exception trace is shown but execution is paused at: <module>)
Parameters to Generic[...] must all be type variables
File "/Users/ringo/anaconda3/envs/glass38/lib/python3.8/typing.py", line 890, in __class_getitem__
raise TypeError(
File "/Users/ringo/anaconda3/envs/glass38/lib/python3.8/typing.py", line 261, in inner
return func(*args, **kwds)
File "/Users/ringo/Repositories/stained-glass-factory/a.py", line 9, in <module> (Current frame)
class A(Generic[P]):
File "/Users/ringo/anaconda3/envs/glass38/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/Users/ringo/anaconda3/envs/glass38/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
TypeError: Parameters to Generic[...] must all be type variables
But when I set a breakpoint immediately after this definition and check ParamSpec("P").__class__, I see <class 'typing_extensions.ParamSpec'>. If I copy and paste the source code for ParamSpec in the debug console and try it again, it actually works as expected...
Expected behavior
I don't expect there to be an error in this class definition when debugging.
Steps to reproduce:
Use conda for M1 and create an environment with python < 3.10
activate and pip install typing_extensions
Use VS Code for Apple Silicon
Run the debugger with justMyCode: false and check User Uncaught Exceptions
Debug the above code
The text was updated successfully, but these errors were encountered:
I am experiencing similar issues on a project I'm working, also on a M1 Mac, but in my case, it manifests when I use the PyCharm debugger with any Django's ./manage.py command.
I am fairly new to the Python ecosystem, so if you need more details about the environment, I'll be happy to provide them.
EDIT:
I used the same code snippet that @ringohoffman provided, and I have the same outcome, which then gives me the feeling this particular issue might not be solely related to this project.
Environment data
I didn't have this problem until today when I switched to conda for M1/M2 (from the Intel based one).
The above code executes fine:
Actual behavior
But when when both:
justMyCode: false
User Uncaught Exceptions
is checkedI get this stack trace:
This occurs because in the
typing_extensions.ParamSpec
for Python<3.10 :But when I set a breakpoint immediately after this definition and check
ParamSpec("P").__class__
, I see<class 'typing_extensions.ParamSpec'>
. If I copy and paste the source code forParamSpec
in the debug console and try it again, it actually works as expected...Expected behavior
I don't expect there to be an error in this class definition when debugging.
Steps to reproduce:
pip install typing_extensions
justMyCode: false
and checkUser Uncaught Exceptions
The text was updated successfully, but these errors were encountered: