From cb1729a927f9084060b9966c938820ac52e0afa3 Mon Sep 17 00:00:00 2001 From: apoorvdarshan Date: Sat, 4 Jul 2026 18:26:51 +0530 Subject: [PATCH] Add functools.partial.__get__ for Python 3.14 partial became a descriptor in 3.14 (python/cpython#121027). --- stdlib/functools.pyi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stdlib/functools.pyi b/stdlib/functools.pyi index 5619a64f6ed2..49b8012c9d6a 100644 --- a/stdlib/functools.pyi +++ b/stdlib/functools.pyi @@ -177,6 +177,9 @@ class partial(Generic[_T]): def keywords(self) -> dict[str, Any]: ... def __new__(cls, func: Callable[..., _T], /, *args: Any, **kwargs: Any) -> Self: ... def __call__(self, /, *args: Any, **kwargs: Any) -> _T: ... + if sys.version_info >= (3, 14): + def __get__(self, instance: Any, owner: type[Any] | None = None, /) -> Callable[..., _T]: ... + def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... # With protocols, this could change into a generic protocol that defines __get__ and returns _T