Make self positional-only in functools.partial and partialmethod (#6822)

This commit is contained in:
Neil Girdhar
2022-01-07 12:19:13 -05:00
committed by GitHub
parent 9558b36a45
commit 1b3d629bc5

View File

@@ -52,7 +52,7 @@ class partial(Generic[_T]):
args: tuple[Any, ...]
keywords: dict[str, Any]
def __new__(cls: Type[_S], __func: Callable[..., _T], *args: Any, **kwargs: Any) -> _S: ...
def __call__(self, *args: Any, **kwargs: Any) -> _T: ...
def __call__(__self, *args: Any, **kwargs: Any) -> _T: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
@@ -88,7 +88,7 @@ class _SingleDispatchCallable(Generic[_T]):
@overload
def register(self, cls: Type[Any], func: Callable[..., _T]) -> Callable[..., _T]: ...
def _clear_cache(self) -> None: ...
def __call__(self, *args: Any, **kwargs: Any) -> _T: ...
def __call__(__self, *args: Any, **kwargs: Any) -> _T: ...
def singledispatch(func: Callable[..., _T]) -> _SingleDispatchCallable[_T]: ...