stdlib: add argument default values (#9501)

This commit is contained in:
Jelle Zijlstra
2023-01-18 00:37:34 -08:00
committed by GitHub
parent 6cb934291f
commit ddfaca3200
272 changed files with 2529 additions and 2467 deletions

View File

@@ -89,26 +89,26 @@ class SMTP:
local_hostname: str
def __init__(
self,
host: str = ...,
port: int = ...,
local_hostname: str | None = ...,
host: str = "",
port: int = 0,
local_hostname: str | None = None,
timeout: float = ...,
source_address: _SourceAddress | None = ...,
source_address: _SourceAddress | None = None,
) -> None: ...
def __enter__(self: Self) -> Self: ...
def __exit__(
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, tb: TracebackType | None
) -> None: ...
def set_debuglevel(self, debuglevel: int) -> None: ...
def connect(self, host: str = ..., port: int = ..., source_address: _SourceAddress | None = ...) -> _Reply: ...
def connect(self, host: str = "localhost", port: int = 0, source_address: _SourceAddress | None = None) -> _Reply: ...
def send(self, s: ReadableBuffer | str) -> None: ...
def putcmd(self, cmd: str, args: str = ...) -> None: ...
def putcmd(self, cmd: str, args: str = "") -> None: ...
def getreply(self) -> _Reply: ...
def docmd(self, cmd: str, args: str = ...) -> _Reply: ...
def helo(self, name: str = ...) -> _Reply: ...
def ehlo(self, name: str = ...) -> _Reply: ...
def docmd(self, cmd: str, args: str = "") -> _Reply: ...
def helo(self, name: str = "") -> _Reply: ...
def ehlo(self, name: str = "") -> _Reply: ...
def has_extn(self, opt: str) -> bool: ...
def help(self, args: str = ...) -> bytes: ...
def help(self, args: str = "") -> bytes: ...
def rset(self) -> _Reply: ...
def noop(self) -> _Reply: ...
def mail(self, sender: str, options: Sequence[str] = ...) -> _Reply: ...
@@ -120,15 +120,15 @@ class SMTP:
def ehlo_or_helo_if_needed(self) -> None: ...
user: str
password: str
def auth(self, mechanism: str, authobject: _AuthObject, *, initial_response_ok: bool = ...) -> _Reply: ...
def auth(self, mechanism: str, authobject: _AuthObject, *, initial_response_ok: bool = True) -> _Reply: ...
@overload
def auth_cram_md5(self, challenge: None = ...) -> None: ...
@overload
def auth_cram_md5(self, challenge: ReadableBuffer) -> str: ...
def auth_plain(self, challenge: ReadableBuffer | None = ...) -> str: ...
def auth_login(self, challenge: ReadableBuffer | None = ...) -> str: ...
def login(self, user: str, password: str, *, initial_response_ok: bool = ...) -> _Reply: ...
def starttls(self, keyfile: str | None = ..., certfile: str | None = ..., context: SSLContext | None = ...) -> _Reply: ...
def auth_plain(self, challenge: ReadableBuffer | None = None) -> str: ...
def auth_login(self, challenge: ReadableBuffer | None = None) -> str: ...
def login(self, user: str, password: str, *, initial_response_ok: bool = True) -> _Reply: ...
def starttls(self, keyfile: str | None = None, certfile: str | None = None, context: SSLContext | None = None) -> _Reply: ...
def sendmail(
self,
from_addr: str,
@@ -140,8 +140,8 @@ class SMTP:
def send_message(
self,
msg: _Message,
from_addr: str | None = ...,
to_addrs: str | Sequence[str] | None = ...,
from_addr: str | None = None,
to_addrs: str | Sequence[str] | None = None,
mail_options: Sequence[str] = ...,
rcpt_options: Sequence[str] = ...,
) -> _SendErrs: ...
@@ -154,14 +154,14 @@ class SMTP_SSL(SMTP):
context: SSLContext
def __init__(
self,
host: str = ...,
port: int = ...,
local_hostname: str | None = ...,
keyfile: str | None = ...,
certfile: str | None = ...,
host: str = "",
port: int = 0,
local_hostname: str | None = None,
keyfile: str | None = None,
certfile: str | None = None,
timeout: float = ...,
source_address: _SourceAddress | None = ...,
context: SSLContext | None = ...,
source_address: _SourceAddress | None = None,
context: SSLContext | None = None,
) -> None: ...
LMTP_PORT: int
@@ -170,10 +170,10 @@ class LMTP(SMTP):
if sys.version_info >= (3, 9):
def __init__(
self,
host: str = ...,
port: int = ...,
local_hostname: str | None = ...,
source_address: _SourceAddress | None = ...,
host: str = "",
port: int = 2003,
local_hostname: str | None = None,
source_address: _SourceAddress | None = None,
timeout: float = ...,
) -> None: ...
else: