mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Akuli and srittau: Remove Python 2 branches from Python 3 stubs (#5461)
* run script and do some manual changes (Akuli) * do the whole thing manually (srittau) * merge changes (Akuli) Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import socket
|
||||
import ssl
|
||||
import sys
|
||||
from typing import Any, BinaryIO, Dict, List, Optional, Pattern, Text, Tuple, overload
|
||||
|
||||
_LongResp = Tuple[bytes, List[bytes], int]
|
||||
@@ -14,9 +13,7 @@ LF: bytes
|
||||
CRLF: bytes
|
||||
|
||||
class POP3:
|
||||
if sys.version_info >= (3, 0):
|
||||
encoding: Text
|
||||
|
||||
encoding: Text
|
||||
host: Text
|
||||
port: int
|
||||
sock: socket.socket
|
||||
@@ -37,37 +34,25 @@ class POP3:
|
||||
def close(self) -> None: ...
|
||||
def rpop(self, user: Text) -> bytes: ...
|
||||
timestamp: Pattern[Text]
|
||||
|
||||
if sys.version_info < (3, 0):
|
||||
def apop(self, user: Text, secret: Text) -> bytes: ...
|
||||
else:
|
||||
def apop(self, user: Text, password: Text) -> bytes: ...
|
||||
def apop(self, user: Text, password: Text) -> bytes: ...
|
||||
def top(self, which: Any, howmuch: int) -> _LongResp: ...
|
||||
@overload
|
||||
def uidl(self) -> _LongResp: ...
|
||||
@overload
|
||||
def uidl(self, which: Any) -> bytes: ...
|
||||
if sys.version_info >= (3, 5):
|
||||
def utf8(self) -> bytes: ...
|
||||
if sys.version_info >= (3, 4):
|
||||
def capa(self) -> Dict[Text, List[Text]]: ...
|
||||
def stls(self, context: Optional[ssl.SSLContext] = ...) -> bytes: ...
|
||||
def utf8(self) -> bytes: ...
|
||||
def capa(self) -> Dict[Text, List[Text]]: ...
|
||||
def stls(self, context: Optional[ssl.SSLContext] = ...) -> bytes: ...
|
||||
|
||||
class POP3_SSL(POP3):
|
||||
if sys.version_info >= (3, 0):
|
||||
def __init__(
|
||||
self,
|
||||
host: Text,
|
||||
port: int = ...,
|
||||
keyfile: Optional[Text] = ...,
|
||||
certfile: Optional[Text] = ...,
|
||||
timeout: float = ...,
|
||||
context: Optional[ssl.SSLContext] = ...,
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(
|
||||
self, host: Text, port: int = ..., keyfile: Optional[Text] = ..., certfile: Optional[Text] = ..., timeout: float = ...
|
||||
) -> None: ...
|
||||
if sys.version_info >= (3, 4):
|
||||
# "context" is actually the last argument, but that breaks LSP and it doesn't really matter because all the arguments are ignored
|
||||
def stls(self, context: Any = ..., keyfile: Any = ..., certfile: Any = ...) -> bytes: ...
|
||||
def __init__(
|
||||
self,
|
||||
host: Text,
|
||||
port: int = ...,
|
||||
keyfile: Optional[Text] = ...,
|
||||
certfile: Optional[Text] = ...,
|
||||
timeout: float = ...,
|
||||
context: Optional[ssl.SSLContext] = ...,
|
||||
) -> None: ...
|
||||
# "context" is actually the last argument, but that breaks LSP and it doesn't really matter because all the arguments are ignored
|
||||
def stls(self, context: Any = ..., keyfile: Any = ..., certfile: Any = ...) -> bytes: ...
|
||||
|
||||
Reference in New Issue
Block a user