Switch to PEP-604 syntax in python2 stubs (#5915)

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
This commit is contained in:
Oleg Höfling
2021-08-14 11:12:30 +02:00
committed by GitHub
parent 431c4f7fc1
commit ff63953188
235 changed files with 2473 additions and 2768 deletions

View File

@@ -1,7 +1,7 @@
import asynchat
import asyncore
import socket
from typing import Any, List, Optional, Text, Tuple, Type, Union
from typing import Any, List, Text, Tuple, Type
_Address = Tuple[str, int] # (host, port)
@@ -29,17 +29,17 @@ class SMTPServer(asyncore.dispatcher):
def __init__(self, localaddr: _Address, remoteaddr: _Address, data_size_limit: int = ...) -> None: ...
def handle_accepted(self, conn: socket.socket, addr: Any) -> None: ...
def process_message(
self, peer: _Address, mailfrom: str, rcpttos: List[Text], data: Union[bytes, str], **kwargs: Any
) -> Optional[str]: ...
self, peer: _Address, mailfrom: str, rcpttos: List[Text], 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[Text], data: Union[bytes, str]
) -> Optional[str]: ...
self, peer: _Address, mailfrom: str, rcpttos: List[Text], data: bytes | str
) -> str | None: ...
class MailmanProxy(PureProxy):
def process_message( # type: ignore
self, peer: _Address, mailfrom: str, rcpttos: List[Text], data: Union[bytes, str]
) -> Optional[str]: ...
self, peer: _Address, mailfrom: str, rcpttos: List[Text], data: bytes | str
) -> str | None: ...