mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -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]): ...
|
||||
|
||||
Reference in New Issue
Block a user