mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -3,10 +3,10 @@ from email.contentmanager import ContentManager
|
||||
from email.errors import MessageDefect
|
||||
from email.header import Header
|
||||
from email.message import Message
|
||||
from typing import Any, Callable, List, Optional, Tuple, Union
|
||||
from typing import Any, Callable, List, Tuple
|
||||
|
||||
class Policy:
|
||||
max_line_length: Optional[int]
|
||||
max_line_length: int | None
|
||||
linesep: str
|
||||
cte_type: str
|
||||
raise_on_defect: bool
|
||||
@@ -15,7 +15,7 @@ class Policy:
|
||||
def clone(self, **kw: Any) -> Policy: ...
|
||||
def handle_defect(self, obj: Message, defect: MessageDefect) -> None: ...
|
||||
def register_defect(self, obj: Message, defect: MessageDefect) -> None: ...
|
||||
def header_max_count(self, name: str) -> Optional[int]: ...
|
||||
def header_max_count(self, name: str) -> int | None: ...
|
||||
@abstractmethod
|
||||
def header_source_parse(self, sourcelines: List[str]) -> Tuple[str, str]: ...
|
||||
@abstractmethod
|
||||
@@ -30,7 +30,7 @@ class Policy:
|
||||
class Compat32(Policy):
|
||||
def header_source_parse(self, sourcelines: List[str]) -> Tuple[str, str]: ...
|
||||
def header_store_parse(self, name: str, value: str) -> Tuple[str, str]: ...
|
||||
def header_fetch_parse(self, name: str, value: str) -> Union[str, Header]: ... # type: ignore
|
||||
def header_fetch_parse(self, name: str, value: str) -> str | Header: ... # type: ignore
|
||||
def fold(self, name: str, value: str) -> str: ...
|
||||
def fold_binary(self, name: str, value: str) -> bytes: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user