Closed
Description
from functools import partial
from typing import Callable, Generic, ParamSpec
P = ParamSpec('P')
class custom_vjp(Generic[P]):
def __init__(self,
fun: Callable[P, None],
x: int = 0):
super().__init__()
self.fun = fun
def __call__(self, *args: P.args, **kwargs: P.kwargs) -> None:
return self.fun(*args, **kwargs)
@partial(custom_vjp, x=1) # error: Argument 1 to "partial" has incompatible type "Type[custom_vjp[Any]]"; expected "Callable[..., custom_vjp[P]]"
def f() -> None:
pass