From 6e4ab75bded79bfef499435832d21b58b3ed6aaa Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Mon, 14 Feb 2022 19:00:59 +0000 Subject: [PATCH] Add missing `__isabstractmethods__` attributes in `abc` and `functools1 --- 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 61b162bf8821..58985067b125 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 ddbbfa3d57b9..b5ffe0c270ad 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