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
{{ message }}
Repository navigation
TypeError when omitting a Protocol type argument with default #636
Traceback (most recent call last):
File "/home/joren/huh.py", line 11, in <module>
B2[str] # TypeError~~^^^^^
File "/home/joren/.pyenv/versions/3.12.11/lib/python3.12/typing.py", line 398, in innerreturn func(*args, **kwds)
^^^^^^^^^^^^^^^^^^^
File "/home/joren/.pyenv/versions/3.12.11/lib/python3.12/typing.py", line 1110, in _generic_class_getitem
_check_generic(cls, params, len(cls.__parameters__))
File "/home/joren/.pyenv/versions/3.12.11/lib/python3.12/site-packages/typing_extensions.py", line 3085, in _check_genericraiseTypeError(f"Too {'many'if alen > elen else'few'} arguments"TypeError: Too few arguments for <class '__main__.B2'>; actual 1, expected at least 1
on 3.9.23:
Traceback (most recent call last):
File "/home/joren/huh.py", line 11, in <module>
B2[str] # TypeError
File "/home/joren/.pyenv/versions/3.9.23/lib/python3.9/typing.py", line 277, in innerreturn func(*args, **kwds)
File "/home/joren/.pyenv/versions/3.9.23/lib/python3.9/typing.py", line 1004, in __class_getitem__
_check_generic(cls, params, len(cls.__parameters__))
File "/home/joren/.pyenv/versions/3.9.23/lib/python3.9/site-packages/typing_extensions.py", line 3049, in _check_genericraiseTypeError(f"Too {'many'if alen > elen else'few'}{things}"TypeError: Too few parameters for <class '__main__.B2'>; actual 1, expected at least 1
And since typing_extensions occurs in the traceback, I figured that this is not the same issue as python/cpython#137191.
Activity
Merge branch 'main' into pythongh-636-backport-137281-param-order
Merge branch 'main' into pythongh-636-backport-137281-param-order