mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-19 02:15:58 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import asynchat
|
||||
import asyncore
|
||||
import socket
|
||||
from typing import Any, DefaultDict, List, Optional, Tuple, Type, Union
|
||||
from typing import Any, DefaultDict, List, Tuple, Type
|
||||
|
||||
_Address = Tuple[str, int] # (host, port)
|
||||
|
||||
@@ -34,7 +34,7 @@ class SMTPChannel(asynchat.async_chat):
|
||||
conn: socket.socket,
|
||||
addr: Any,
|
||||
data_size_limit: int = ...,
|
||||
map: Optional[asyncore._maptype] = ...,
|
||||
map: asyncore._maptype | None = ...,
|
||||
enable_SMTPUTF8: bool = ...,
|
||||
decode_data: bool = ...,
|
||||
) -> None: ...
|
||||
@@ -64,23 +64,23 @@ class SMTPServer(asyncore.dispatcher):
|
||||
localaddr: _Address,
|
||||
remoteaddr: _Address,
|
||||
data_size_limit: int = ...,
|
||||
map: Optional[asyncore._maptype] = ...,
|
||||
map: asyncore._maptype | None = ...,
|
||||
enable_SMTPUTF8: bool = ...,
|
||||
decode_data: bool = ...,
|
||||
) -> None: ...
|
||||
def handle_accepted(self, conn: socket.socket, addr: Any) -> None: ...
|
||||
def process_message(
|
||||
self, peer: _Address, mailfrom: str, rcpttos: List[str], data: Union[bytes, str], **kwargs: Any
|
||||
) -> Optional[str]: ...
|
||||
self, peer: _Address, mailfrom: str, rcpttos: List[str], data: bytes | str, **kwargs: Any
|
||||
) -> str | None: ...
|
||||
|
||||
class DebuggingServer(SMTPServer): ...
|
||||
|
||||
class PureProxy(SMTPServer):
|
||||
def process_message( # type: ignore
|
||||
self, peer: _Address, mailfrom: str, rcpttos: List[str], data: Union[bytes, str]
|
||||
) -> Optional[str]: ...
|
||||
self, peer: _Address, mailfrom: str, rcpttos: List[str], data: bytes | str
|
||||
) -> str | None: ...
|
||||
|
||||
class MailmanProxy(PureProxy):
|
||||
def process_message( # type: ignore
|
||||
self, peer: _Address, mailfrom: str, rcpttos: List[str], data: Union[bytes, str]
|
||||
) -> Optional[str]: ...
|
||||
self, peer: _Address, mailfrom: str, rcpttos: List[str], data: bytes | str
|
||||
) -> str | None: ...
|
||||
|
||||
Reference in New Issue
Block a user