Use PEP 585 syntax wherever possible (#6717)

This commit is contained in:
Alex Waygood
2021-12-28 10:31:43 +00:00
committed by GitHub
parent e6cb341d94
commit 8d5d2520ac
237 changed files with 966 additions and 1069 deletions

View File

@@ -1,5 +1,5 @@
import sys
from typing import Any, Dict, Generic, Iterable, Mapping, TypeVar, Union, overload
from typing import Any, Generic, Iterable, Mapping, TypeVar, Union, overload
if sys.version_info >= (3, 9):
from types import GenericAlias
@@ -18,7 +18,7 @@ def _unquote(str: str) -> str: ...
class CookieError(Exception): ...
class Morsel(Dict[str, Any], Generic[_T]):
class Morsel(dict[str, Any], Generic[_T]):
value: str
coded_value: _T
key: str
@@ -40,7 +40,7 @@ class Morsel(Dict[str, Any], Generic[_T]):
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
class BaseCookie(Dict[str, Morsel[_T]], Generic[_T]):
class BaseCookie(dict[str, Morsel[_T]], Generic[_T]):
def __init__(self, input: _DataType | None = ...) -> None: ...
def value_decode(self, val: str) -> _T: ...
def value_encode(self, val: _T) -> str: ...