Big diff: Use new "|" union syntax (#5872)

This commit is contained in:
Akuli authored and GitHub committed 2021-08-08 11:05:21 +02:00
1 parent b9adb7a874
commit ee487304d7
578 files changed
+8080 -8966

No files matched your search

+9 -9
View File
@@ -1,5 +1,5 @@
import sys
from typing import Any, Dict, Generic, Iterable, List, Mapping, Optional, Tuple, TypeVar, Union, overload
from typing import Any, Dict, Generic, Iterable, List, Mapping, Tuple, TypeVar, Union, overload
if sys.version_info >= (3, 9):
from types import GenericAlias
@@ -27,26 +27,26 @@ class Morsel(Dict[str, Any], Generic[_T]):
def set(self, key: str, val: str, coded_val: _T) -> None: ...
else:
def set(self, key: str, val: str, coded_val: _T, LegalChars: str = ...) -> None: ...
def setdefault(self, key: str, val: Optional[str] = ...) -> str: ...
def setdefault(self, key: str, val: str | None = ...) -> str: ...
# The dict update can also get a keywords argument so this is incompatible
@overload # type: ignore
def update(self, values: Mapping[str, str]) -> None: ...
@overload
def update(self, values: Iterable[Tuple[str, str]]) -> None: ...
def isReservedKey(self, K: str) -> bool: ...
def output(self, attrs: Optional[List[str]] = ..., header: str = ...) -> str: ...
def js_output(self, attrs: Optional[List[str]] = ...) -> str: ...
def OutputString(self, attrs: Optional[List[str]] = ...) -> str: ...
def output(self, attrs: List[str] | None = ..., header: str = ...) -> str: ...
def js_output(self, attrs: List[str] | None = ...) -> str: ...
def OutputString(self, attrs: List[str] | None = ...) -> str: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
class BaseCookie(Dict[str, Morsel[_T]], Generic[_T]):
def __init__(self, input: Optional[_DataType] = ...) -> None: ...
def __init__(self, input: _DataType | None = ...) -> None: ...
def value_decode(self, val: str) -> _T: ...
def value_encode(self, val: _T) -> str: ...
def output(self, attrs: Optional[List[str]] = ..., header: str = ..., sep: str = ...) -> str: ...
def js_output(self, attrs: Optional[List[str]] = ...) -> str: ...
def output(self, attrs: List[str] | None = ..., header: str = ..., sep: str = ...) -> str: ...
def js_output(self, attrs: List[str] | None = ...) -> str: ...
def load(self, rawdata: _DataType) -> None: ...
def __setitem__(self, key: str, value: Union[str, Morsel[_T]]) -> None: ...
def __setitem__(self, key: str, value: str | Morsel[_T]) -> None: ...
class SimpleCookie(BaseCookie[_T], Generic[_T]): ...