Skip to content

Conversation

@YouJiacheng
Copy link
Contributor

Fix #9932 without breaking #9950

@YouJiacheng
Copy link
Contributor Author

@froystig WDYT?

@YouJiacheng
Copy link
Contributor Author

YouJiacheng commented Mar 23, 2022

Emmm, it seems that type checking tool doesn't support ParamSpec

error: Argument 1 to "partial" has incompatible type "Callable[[Callable[P, T], DefaultNamedArg(Union[int, Iterable[int], None], 'static_argnums'), DefaultNamedArg(Union[str, Iterable[str], None], 'static_argnames'), DefaultNamedArg(Optional[Device], 'device'), DefaultNamedArg(Optional[str], 'backend'), DefaultNamedArg(Union[int, Iterable[int]], 'donate_argnums'), DefaultNamedArg(bool, 'inline')], Wrapped[P, T]]"; expected "Callable[..., Wrapped[P, T]]"  [arg-type]
Argument 4 to "__call__" of "Wrapped" has incompatible type "Sequence[int]"; expected "P.args"  [arg-type]

@YouJiacheng
Copy link
Contributor Author

YouJiacheng commented Apr 15, 2022

Ah, I find that it is a mypy bug: it doesn't handle partial with decorator correctly, while pylance can.
python/mypy#12593

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add IDE friendly type annotation for jit

2 participants