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 diff --git a/stubs/boltons/boltons/funcutils.pyi b/stubs/boltons/boltons/funcutils.pyi index 0102bc154b33..810bd5a0c7b1 100644 --- a/stubs/boltons/boltons/funcutils.pyi +++ b/stubs/boltons/boltons/funcutils.pyi @@ -26,14 +26,14 @@ def copy_function(orig, copy_dict: bool = True): ... def partial_ordering(cls): ... class InstancePartial(functools.partial[Incomplete]): - def __get__(self, obj, obj_type): ... + def __get__(self, obj, obj_type): ... # type: ignore[override] class CachedInstancePartial(functools.partial[Incomplete]): __name__: Incomplete def __set_name__(self, obj_type, name) -> None: ... __doc__: Incomplete __module__: Incomplete - def __get__(self, obj, obj_type): ... + def __get__(self, obj, obj_type): ... # type: ignore[override] partial = CachedInstancePartial