basedpyright
basedpyright copied to clipboard
Special case `functools.partial`
my_dataclass = functools.partial(dataclass, kw_only=True)
@my_dataclass
class A:
doesnt_works: bool = True # 😭
It should remember the original thing being called, this would fix a lot of different problems.
i don't think it needs special casing. functools.partial should use ParamSpec and Concatenate, its current signature sucks because it just uses Any:
class partial(Generic[_T]):
...
def __call__(self, /, *args: Any, **kwargs: Any) -> _T: ...