From dea12b2c47f8e03722432a25a1d08df940e86824 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Mon, 14 Feb 2022 19:20:07 +0000 Subject: [PATCH] Add missing `__isabstractmethods__` attributes in `abc` and `functools1 (#7205) --- stdlib/abc.pyi | 4 +++- stdlib/functools.pyi | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/stdlib/abc.pyi b/stdlib/abc.pyi index 61b162bf8..58985067b 100644 --- a/stdlib/abc.pyi +++ b/stdlib/abc.pyi @@ -27,7 +27,9 @@ class abstractstaticmethod(staticmethod[_R_co], Generic[_R_co]): __isabstractmethod__: Literal[True] def __init__(self, callable: Callable[..., _R_co]) -> None: ... -class abstractproperty(property): ... +class abstractproperty(property): + __isabstractmethod__: Literal[True] + class ABC(metaclass=ABCMeta): ... def get_cache_token() -> object: ... diff --git a/stdlib/functools.pyi b/stdlib/functools.pyi index ddbbfa3d5..b5ffe0c27 100644 --- a/stdlib/functools.pyi +++ b/stdlib/functools.pyi @@ -99,6 +99,8 @@ if sys.version_info >= (3, 8): dispatcher: _SingleDispatchCallable[_T] func: Callable[..., _T] def __init__(self, func: Callable[..., _T]) -> None: ... + @property + def __isabstractmethod__(self) -> bool: ... @overload def register(self, cls: type[Any], method: None = ...) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... @overload