Use PEP 585 syntax wherever possible (#6717)

This commit is contained in:
Alex Waygood authored and GitHub committed 2021-12-28 11:31:43 +01:00
1 parent e6cb341d94
commit 8d5d2520ac
237 files changed
+966 -1069

No files matched your search

+4 -4
View File
@@ -1,5 +1,5 @@
from _weakrefset import WeakSet as WeakSet
from typing import Any, Callable, Generic, Iterable, Iterator, Mapping, MutableMapping, Tuple, Type, TypeVar, overload
from typing import Any, Callable, Generic, Iterable, Iterator, Mapping, MutableMapping, Type, TypeVar, overload
from _weakref import (
CallableProxyType as CallableProxyType,
@@ -17,7 +17,7 @@ _KT = TypeVar("_KT")
_VT = TypeVar("_VT")
_CallableT = TypeVar("_CallableT", bound=Callable[..., Any])
ProxyTypes: Tuple[Type[Any], ...]
ProxyTypes: tuple[Type[Any], ...]
class WeakMethod(ref[_CallableT], Generic[_CallableT]):
def __new__(cls, meth: _CallableT, callback: Callable[[_CallableT], object] | None = ...) -> WeakMethod[_CallableT]: ...
@@ -81,7 +81,7 @@ class WeakKeyDictionary(MutableMapping[_KT, _VT]):
class finalize:
def __init__(self, __obj: object, __func: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ...
def __call__(self, _: Any = ...) -> Any | None: ...
def detach(self) -> tuple[Any, Any, Tuple[Any, ...], dict[str, Any]] | None: ...
def peek(self) -> tuple[Any, Any, Tuple[Any, ...], dict[str, Any]] | None: ...
def detach(self) -> tuple[Any, Any, tuple[Any, ...], dict[str, Any]] | None: ...
def peek(self) -> tuple[Any, Any, tuple[Any, ...], dict[str, Any]] | None: ...
alive: bool
atexit: bool