Contradictory errors for ParamSpec defaults
Closed this issue · 3 comments
diceroll123 commented
I see contradicting errors for
type AliasTuple[**P = (int, str)] = Callable[P, int]
The contradicting errors:
Tuple expression not allowed in type expression
Expected ellipsis, a tuple expression, or ParamSpec for default value of ParamSpec
erictraut commented
Pyright is working as intended here. Both of these error messages apply, and they are not contradictory. One is a syntax error message, the other is a semantic error. If you fix the issue, both errors will go away.
JelleZijlstra commented
The second error message is incorrect, because it says a "tuple expression" is among the allowed options. In fact, pyright allows only a list expression here, so that's what that error message should say.
billfelix commented
收到,谢谢您的来信。我将及时回复您!
祝好!