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
Full ParamSpec support is on the way(#8645) but until that time, completely valid usages of ParamSpec and Concatenate are met with perplexing error messages that most people would misinterpret as misusing the feature.
I believe it would be at least 10 times more understandable if mypy showed a warning in these circumstances:
fromtypingimporttype_check_only, ParamSpec, Concatenate, Callable@type_check_only# no warning about unsupported functionalitydeffoo() ->None: ...
P=ParamSpec("P")
defbar(func: # error: The first argument to Callable must be a list of types or "..."Callable[
Concatenate[P, int],
None,
]
) ->None: #
...
I was trying to implement Concatenate for a while before realizing it was unsupported, since I thought I was simply using it incorrectly. This would be very nice to have! 👍 Another example of a as-yet unsupported feature: Self.
This is the current result of using Concatenate, FYI:
...: error: The first argument to Callable must be a list of types or "..." [misc]
...: error: Incompatible return value type (got "Callable[P, None]", expected "Callable[P, None]") [return-value]
Full
ParamSpec
support is on the way(#8645) but until that time, completely valid usages ofParamSpec
andConcatenate
are met with perplexing error messages that most people would misinterpret as misusing the feature.I believe it would be at least 10 times more understandable if mypy showed a warning in these circumstances:
Proposed behavior:
Idk if it's possible to determine what would constitute a warning, next best thing would be to show the current error with an info message.
The text was updated successfully, but these errors were encountered: