Skip to content

Fix a few issues with parameter defaults #9572

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stdlib/asyncore.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down
14 changes: 7 additions & 7 deletions stdlib/collections/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down Expand Up @@ -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: ...
Expand Down
2 changes: 1 addition & 1 deletion stdlib/ctypes/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 6 additions & 2 deletions stdlib/email/parser.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
2 changes: 1 addition & 1 deletion stdlib/multiprocessing/heap.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...

Expand Down
4 changes: 1 addition & 3 deletions stdlib/platform.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

part of me wants to keep this as an easter egg

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's iconic

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
Expand Down
2 changes: 1 addition & 1 deletion stdlib/pydoc.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down
7 changes: 6 additions & 1 deletion stdlib/socket.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 11 additions & 11 deletions stdlib/ssl.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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]
Expand All @@ -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: ...
Expand Down
4 changes: 2 additions & 2 deletions stdlib/sysconfig.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...

Expand Down