Add @final to many unsubclassable stdlib classes (#6299)

This commit is contained in:
Alex Waygood
2021-11-15 13:45:24 +00:00
committed by GitHub
parent 5b94c6a94d
commit 10c9d8cfce
17 changed files with 48 additions and 9 deletions

View File

@@ -1,5 +1,6 @@
import sys
from typing import Any, Callable, Generic, TypeVar, overload
from typing_extensions import final
if sys.version_info >= (3, 9):
from types import GenericAlias
@@ -7,9 +8,11 @@ if sys.version_info >= (3, 9):
_C = TypeVar("_C", bound=Callable[..., Any])
_T = TypeVar("_T")
@final
class CallableProxyType(Generic[_C]): # "weakcallableproxy"
def __getattr__(self, attr: str) -> Any: ...
@final
class ProxyType(Generic[_T]): # "weakproxy"
def __getattr__(self, attr: str) -> Any: ...