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
(🐞) Bad error message when using Concatenate incorrectly #13518
Despite the fact that a good message is output afterwards, the initial error seems like nonsense: "first arg to Callable must be a parameter specification". Huh? it is a ParamSpec?! I presume that this is because the type becomes Any (from error) due to the args being invalid. At runtime the type here would be Never (because it would raise).
main.py:5: error: The first argument to Callable must be a list of types, parameter specification, or "..."
main.py:5: note: See https://mypy.readthedocs.io/en/stable/kinds_of_types.html#callable-types-and-lambdas
main.py:5: error: The last parameter to Concatenate needs to be a ParamSpec
Found 2 errors in 1 file (checked 1 source file)
@sobolevn Should the message The first argument to Callable must be a list of types, parameter specification, or "..." be updated to include Concatenate or do you think that Concatenate falls under "parameter specification"?
Does MyPy actually support Concatenate? I attempted to use it, but it's rejecting my first parameter in Callable[Concatenate[Dict[str, sa.Table], P], sa.sql.expression.Selectable]
Activity
Improve error message for callables with invalid `Concatenate`, refs p…
Improve error message for callables with invalid `Concatenate`, refs p…
KotlinIsland commentedon Aug 28, 2022
@sobolevn Should the message
The first argument to Callable must be a list of types, parameter specification, or "..."be updated to includeConcatenateor do you think thatConcatenatefalls under "parameter specification"?sobolevn commentedon Aug 28, 2022
I think this is correct 🤔
gandhis1 commentedon Nov 10, 2022
Does MyPy actually support
Concatenate? I attempted to use it, but it's rejecting my first parameter inCallable[Concatenate[Dict[str, sa.Table], P], sa.sql.expression.Selectable]Allow Ellipsis in Concatenate; cleanup ParamSpec literals (#15905)