Remove compatibility aliases (#5464)

* Remove compatibility aliases

Remove a few instances of Text

Use aliases from _typeshed

* Remove unused imports
This commit is contained in:
Sebastian Rittau
2021-05-15 19:49:20 +02:00
committed by GitHub
parent 056981b957
commit 841a365284
26 changed files with 483 additions and 585 deletions

View File

@@ -1,6 +1,6 @@
import socket
import ssl
from typing import Any, BinaryIO, Dict, List, Optional, Pattern, Text, Tuple, overload
from typing import Any, BinaryIO, Dict, List, Optional, Pattern, Tuple, overload
_LongResp = Tuple[bytes, List[bytes], int]
@@ -13,17 +13,17 @@ LF: bytes
CRLF: bytes
class POP3:
encoding: Text
host: Text
encoding: str
host: str
port: int
sock: socket.socket
file: BinaryIO
welcome: bytes
def __init__(self, host: Text, port: int = ..., timeout: float = ...) -> None: ...
def __init__(self, host: str, port: int = ..., timeout: float = ...) -> None: ...
def getwelcome(self) -> bytes: ...
def set_debuglevel(self, level: int) -> None: ...
def user(self, user: Text) -> bytes: ...
def pass_(self, pswd: Text) -> bytes: ...
def user(self, user: str) -> bytes: ...
def pass_(self, pswd: str) -> bytes: ...
def stat(self) -> Tuple[int, int]: ...
def list(self, which: Optional[Any] = ...) -> _LongResp: ...
def retr(self, which: Any) -> _LongResp: ...
@@ -32,25 +32,25 @@ class POP3:
def rset(self) -> bytes: ...
def quit(self) -> bytes: ...
def close(self) -> None: ...
def rpop(self, user: Text) -> bytes: ...
timestamp: Pattern[Text]
def apop(self, user: Text, password: Text) -> bytes: ...
def rpop(self, user: str) -> bytes: ...
timestamp: Pattern[str]
def apop(self, user: str, password: str) -> bytes: ...
def top(self, which: Any, howmuch: int) -> _LongResp: ...
@overload
def uidl(self) -> _LongResp: ...
@overload
def uidl(self, which: Any) -> bytes: ...
def utf8(self) -> bytes: ...
def capa(self) -> Dict[Text, List[Text]]: ...
def capa(self) -> Dict[str, List[str]]: ...
def stls(self, context: Optional[ssl.SSLContext] = ...) -> bytes: ...
class POP3_SSL(POP3):
def __init__(
self,
host: Text,
host: str,
port: int = ...,
keyfile: Optional[Text] = ...,
certfile: Optional[Text] = ...,
keyfile: Optional[str] = ...,
certfile: Optional[str] = ...,
timeout: float = ...,
context: Optional[ssl.SSLContext] = ...,
) -> None: ...