From 9488b58fb39700b5852da823011d38ed4d272f53 Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Wed, 18 Sep 2019 02:04:53 -0700 Subject: [PATCH] Copy a better definition of abstractmethod from 3/abc to 2/abc. (#3242) --- stdlib/2/abc.pyi | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stdlib/2/abc.pyi b/stdlib/2/abc.pyi index 746f5306f..e5fe035f2 100644 --- a/stdlib/2/abc.pyi +++ b/stdlib/2/abc.pyi @@ -1,9 +1,11 @@ -from typing import Any, Dict, Set, Tuple, Type +from typing import Any, Callable, Dict, Set, Tuple, Type, TypeVar import _weakrefset +_FuncT = TypeVar('_FuncT', bound=Callable[..., Any]) + # NOTE: mypy has special processing for ABCMeta and abstractmethod. -def abstractmethod(funcobj: Any) -> Any: ... +def abstractmethod(funcobj: _FuncT) -> _FuncT: ... class ABCMeta(type): # TODO: FrozenSet