From d4f07254526840102f02f7f968b2e5a473b45c33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20W=C3=B6rtwein?= Date: Tue, 31 Aug 2021 03:07:57 -0400 Subject: [PATCH] BUG: typing.final supports properties (#5985) Fixes #5984 --- stdlib/typing.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/typing.pyi b/stdlib/typing.pyi index b028e5e70..c476899b8 100644 --- a/stdlib/typing.pyi +++ b/stdlib/typing.pyi @@ -37,6 +37,7 @@ class _SpecialForm: _F = TypeVar("_F", bound=Callable[..., Any]) _P = _ParamSpec("_P") +_T = TypeVar("_T") def overload(func: _F) -> _F: ... @@ -51,7 +52,7 @@ Type: _SpecialForm = ... ClassVar: _SpecialForm = ... if sys.version_info >= (3, 8): Final: _SpecialForm = ... - def final(f: _F) -> _F: ... + def final(f: _T) -> _T: ... Literal: _SpecialForm = ... # TypedDict is a (non-subscriptable) special form. TypedDict: object @@ -88,7 +89,6 @@ if sys.version_info >= (3, 10): NoReturn = Union[None] # These type variables are used by the container types. -_T = TypeVar("_T") _S = TypeVar("_S") _KT = TypeVar("_KT") # Key type. _VT = TypeVar("_VT") # Value type.