Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
Closed
Description
Bug report
Bug description:
In accordance to the typing specifications,default= ofParamSpec can take an ellipsis.... However, this is not handled properly with old-style generics in the following example and causes a runtime error:
fromtypingimportGeneric,ParamSpec,TypeVarP_default=ParamSpec("P_default",default=...)T=TypeVar("T")T_default=TypeVar("T_default",default=object)classA(Generic[T,P_default,T_default]):pass
>>> A[int]Traceback (most recent call last): ...TypeError: can only concatenate list (not "tuple") to listCPython versions tested on:
3.13
Operating systems tested on:
Linux
Linked PRs
- gh-138859: Fix
TypeErrorwhen there is aParamSpecsubstitution with a default #138867 - gh-138859: Account for
ParamSpecdefaults that are not lists … #138868 - [3.14] gh-138859: Account for
ParamSpecdefaults that are not lists … (GH-138868) #140207 - [3.13] gh-138859: Account for
ParamSpecdefaults that are not lists … (GH-138868) #140208