Fix a few issues with parameter defaults (#9572)

This commit is contained in:
Alex Waygood
2023-01-20 17:47:59 +00:00
committed by GitHub
parent 7e40d70cad
commit d98d1674e7
10 changed files with 37 additions and 30 deletions

View File

@@ -36,7 +36,7 @@ class dispatcher:
def __init__(self, sock: _Socket | None = None, map: _MapType | None = None) -> None: ...
def add_channel(self, map: _MapType | None = None) -> None: ...
def del_channel(self, map: _MapType | None = None) -> None: ...
def create_socket(self, family: int = 2, type: int = 1) -> None: ...
def create_socket(self, family: int = ..., type: int = ...) -> None: ...
def set_socket(self, sock: _Socket, map: _MapType | None = None) -> None: ...
def set_reuse_addr(self) -> None: ...
def readable(self) -> bool: ...

View File

@@ -163,18 +163,18 @@ class UserString(Sequence[UserString]):
def capitalize(self: Self) -> Self: ...
def casefold(self: Self) -> Self: ...
def center(self: Self, width: int, *args: Any) -> Self: ...
def count(self, sub: str | UserString, start: int = 0, end: int = 9223372036854775807) -> int: ...
def count(self, sub: str | UserString, start: int = 0, end: int = ...) -> int: ...
if sys.version_info >= (3, 8):
def encode(self: UserString, encoding: str | None = "utf-8", errors: str | None = "strict") -> bytes: ...
else:
def encode(self: Self, encoding: str | None = ..., errors: str | None = ...) -> Self: ...
def endswith(self, suffix: str | tuple[str, ...], start: int | None = 0, end: int | None = 9223372036854775807) -> bool: ...
def endswith(self, suffix: str | tuple[str, ...], start: int | None = 0, end: int | None = ...) -> bool: ...
def expandtabs(self: Self, tabsize: int = 8) -> Self: ...
def find(self, sub: str | UserString, start: int = 0, end: int = 9223372036854775807) -> int: ...
def find(self, sub: str | UserString, start: int = 0, end: int = ...) -> int: ...
def format(self, *args: Any, **kwds: Any) -> str: ...
def format_map(self, mapping: Mapping[str, Any]) -> str: ...
def index(self, sub: str, start: int = 0, end: int = 9223372036854775807) -> int: ...
def index(self, sub: str, start: int = 0, end: int = ...) -> int: ...
def isalpha(self) -> bool: ...
def isalnum(self) -> bool: ...
def isdecimal(self) -> bool: ...
@@ -203,15 +203,15 @@ class UserString(Sequence[UserString]):
def removesuffix(self: Self, __suffix: str | UserString) -> Self: ...
def replace(self: Self, old: str | UserString, new: str | UserString, maxsplit: int = -1) -> Self: ...
def rfind(self, sub: str | UserString, start: int = 0, end: int = 9223372036854775807) -> int: ...
def rindex(self, sub: str | UserString, start: int = 0, end: int = 9223372036854775807) -> int: ...
def rfind(self, sub: str | UserString, start: int = 0, end: int = ...) -> int: ...
def rindex(self, sub: str | UserString, start: int = 0, end: int = ...) -> int: ...
def rjust(self: Self, width: int, *args: Any) -> Self: ...
def rpartition(self, sep: str) -> tuple[str, str, str]: ...
def rstrip(self: Self, chars: str | None = None) -> Self: ...
def split(self, sep: str | None = None, maxsplit: int = -1) -> list[str]: ...
def rsplit(self, sep: str | None = None, maxsplit: int = -1) -> list[str]: ...
def splitlines(self, keepends: bool = False) -> list[str]: ...
def startswith(self, prefix: str | tuple[str, ...], start: int | None = 0, end: int | None = 9223372036854775807) -> bool: ...
def startswith(self, prefix: str | tuple[str, ...], start: int | None = 0, end: int | None = ...) -> bool: ...
def strip(self: Self, chars: str | None = None) -> Self: ...
def swapcase(self: Self) -> Self: ...
def title(self: Self) -> Self: ...

View File

@@ -25,7 +25,7 @@ class CDLL:
def __init__(
self,
name: str | None,
mode: int = 4,
mode: int = ...,
handle: int | None = None,
use_errno: bool = False,
use_last_error: bool = False,

View File

@@ -11,11 +11,15 @@ class Parser:
def parse(self, fp: TextIO, headersonly: bool = False) -> Message: ...
def parsestr(self, text: str, headersonly: bool = False) -> Message: ...
class HeaderParser(Parser): ...
class HeaderParser(Parser):
def parse(self, fp: TextIO, headersonly: bool = True) -> Message: ...
def parsestr(self, text: str, headersonly: bool = True) -> Message: ...
class BytesParser:
def __init__(self, _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> None: ...
def parse(self, fp: BinaryIO, headersonly: bool = False) -> Message: ...
def parsebytes(self, text: bytes | bytearray, headersonly: bool = False) -> Message: ...
class BytesHeaderParser(BytesParser): ...
class BytesHeaderParser(BytesParser):
def parse(self, fp: BinaryIO, headersonly: bool = True) -> Message: ...
def parsebytes(self, text: bytes | bytearray, headersonly: bool = True) -> Message: ...

View File

@@ -27,7 +27,7 @@ if sys.platform != "win32":
def rebuild_arena(size: int, dupfd: _SupportsDetach) -> Arena: ...
class Heap:
def __init__(self, size: int = 16384) -> None: ...
def __init__(self, size: int = ...) -> None: ...
def free(self, block: _Block) -> None: ...
def malloc(self, size: int) -> _Block: ...

View File

@@ -37,9 +37,7 @@ def java_ver(
release: str = "", vendor: str = "", vminfo: tuple[str, str, str] = ..., osinfo: tuple[str, str, str] = ...
) -> tuple[str, str, tuple[str, str, str], tuple[str, str, str]]: ...
def system_alias(system: str, release: str, version: str) -> tuple[str, str, str]: ...
def architecture(
executable: str = "/Users/jelle/py/venvs/py311/bin/python", bits: str = "", linkage: str = ""
) -> tuple[str, str]: ...
def architecture(executable: str = ..., bits: str = "", linkage: str = "") -> tuple[str, str]: ...
class uname_result(NamedTuple):
system: str

View File

@@ -58,7 +58,7 @@ class Doc:
def docproperty(self, object: object, name: str | None = None, *args: Any) -> str: ...
@abstractmethod
def docdata(self, object: object, name: str | None = None, *args: Any) -> str: ...
def getdocloc(self, object: object, basedir: str = "/Users/jelle/.pyenv/versions/3.11.1/lib/python3.11") -> str | None: ...
def getdocloc(self, object: object, basedir: str = ...) -> str | None: ...
class HTMLRepr(Repr):
def escape(self, text: str) -> str: ...

View File

@@ -779,7 +779,12 @@ else:
if sys.version_info >= (3, 8):
def has_dualstack_ipv6() -> bool: ...
def create_server(
address: _Address, *, family: int = 2, backlog: int | None = None, reuse_port: bool = False, dualstack_ipv6: bool = False
address: _Address,
*,
family: int = ...,
backlog: int | None = None,
reuse_port: bool = False,
dualstack_ipv6: bool = False,
) -> socket: ...
# the 5th tuple item is an address

View File

@@ -49,8 +49,8 @@ def wrap_socket(
keyfile: StrOrBytesPath | None = None,
certfile: StrOrBytesPath | None = None,
server_side: bool = False,
cert_reqs: int = 0,
ssl_version: int = 2,
cert_reqs: int = ...,
ssl_version: int = ...,
ca_certs: str | None = None,
do_handshake_on_connect: bool = True,
suppress_ragged_eofs: bool = True,
@@ -68,7 +68,7 @@ if sys.version_info >= (3, 10):
def _create_unverified_context(
protocol: int | None = None,
*,
cert_reqs: int = 0,
cert_reqs: int = ...,
check_hostname: bool = False,
purpose: Purpose = ...,
certfile: StrOrBytesPath | None = None,
@@ -83,13 +83,13 @@ else:
protocol: int = ...,
*,
cert_reqs: int = ...,
check_hostname: bool = ...,
check_hostname: bool = False,
purpose: Purpose = ...,
certfile: StrOrBytesPath | None = ...,
keyfile: StrOrBytesPath | None = ...,
cafile: StrOrBytesPath | None = ...,
capath: StrOrBytesPath | None = ...,
cadata: str | ReadableBuffer | None = ...,
certfile: StrOrBytesPath | None = None,
keyfile: StrOrBytesPath | None = None,
cafile: StrOrBytesPath | None = None,
capath: StrOrBytesPath | None = None,
cadata: str | ReadableBuffer | None = None,
) -> SSLContext: ...
_create_default_https_context: Callable[..., SSLContext]
@@ -107,11 +107,11 @@ def cert_time_to_seconds(cert_time: str) -> int: ...
if sys.version_info >= (3, 10):
def get_server_certificate(
addr: tuple[str, int], ssl_version: int = 16, ca_certs: str | None = None, timeout: float = ...
addr: tuple[str, int], ssl_version: int = ..., ca_certs: str | None = None, timeout: float = ...
) -> str: ...
else:
def get_server_certificate(addr: tuple[str, int], ssl_version: int = ..., ca_certs: str | None = ...) -> str: ...
def get_server_certificate(addr: tuple[str, int], ssl_version: int = ..., ca_certs: str | None = None) -> str: ...
def DER_cert_to_PEM_cert(der_cert_bytes: ReadableBuffer) -> str: ...
def PEM_cert_to_DER_cert(pem_cert_string: str) -> bytes: ...

View File

@@ -28,8 +28,8 @@ if sys.version_info >= (3, 10):
def get_preferred_scheme(key: Literal["prefix", "home", "user"]) -> str: ...
def get_path_names() -> tuple[str, ...]: ...
def get_path(name: str, scheme: str = "venv", vars: dict[str, Any] | None = None, expand: bool = True) -> str: ...
def get_paths(scheme: str = "venv", vars: dict[str, Any] | None = None, expand: bool = True) -> dict[str, str]: ...
def get_path(name: str, scheme: str = ..., vars: dict[str, Any] | None = None, expand: bool = True) -> str: ...
def get_paths(scheme: str = ..., vars: dict[str, Any] | None = None, expand: bool = True) -> dict[str, str]: ...
def get_python_version() -> str: ...
def get_platform() -> str: ...