Add more defaults to the stdlib (#9606)

Continuing work towards #8988.

The first five commits were created using stubdefaulter on various Python versions; the following commits were all created manually by me to fix various problems. The main things this adds that weren't present in #9501 are:

- Defaults in Windows-only modules and Windows-only branches (because I'm running a Windows machine)
- Defaults in non-py311 branches
- Defaults for float parameters
- Defaults for overloads
This commit is contained in:
Alex Waygood
2023-01-29 01:51:23 +00:00
committed by GitHub
parent 25e02db42c
commit 33a62ae42d
150 changed files with 2761 additions and 2704 deletions

View File

@@ -8,11 +8,11 @@ _StylesType: TypeAlias = tuple[Any, ...]
class NullFormatter:
writer: NullWriter | None
def __init__(self, writer: NullWriter | None = ...) -> None: ...
def __init__(self, writer: NullWriter | None = None) -> None: ...
def end_paragraph(self, blankline: int) -> None: ...
def add_line_break(self) -> None: ...
def add_hor_rule(self, *args: Any, **kw: Any) -> None: ...
def add_label_data(self, format: str, counter: int, blankline: int | None = ...) -> None: ...
def add_label_data(self, format: str, counter: int, blankline: int | None = None) -> None: ...
def add_flowing_data(self, data: str) -> None: ...
def add_literal_data(self, data: str) -> None: ...
def flush_softspace(self) -> None: ...
@@ -24,8 +24,8 @@ class NullFormatter:
def pop_margin(self) -> None: ...
def set_spacing(self, spacing: str | None) -> None: ...
def push_style(self, *styles: _StylesType) -> None: ...
def pop_style(self, n: int = ...) -> None: ...
def assert_line_data(self, flag: int = ...) -> None: ...
def pop_style(self, n: int = 1) -> None: ...
def assert_line_data(self, flag: int = 1) -> None: ...
class AbstractFormatter:
writer: NullWriter
@@ -45,7 +45,7 @@ class AbstractFormatter:
def end_paragraph(self, blankline: int) -> None: ...
def add_line_break(self) -> None: ...
def add_hor_rule(self, *args: Any, **kw: Any) -> None: ...
def add_label_data(self, format: str, counter: int, blankline: int | None = ...) -> None: ...
def add_label_data(self, format: str, counter: int, blankline: int | None = None) -> None: ...
def format_counter(self, format: Iterable[str], counter: int) -> str: ...
def format_letter(self, case: str, counter: int) -> str: ...
def format_roman(self, case: str, counter: int) -> str: ...
@@ -60,8 +60,8 @@ class AbstractFormatter:
def pop_margin(self) -> None: ...
def set_spacing(self, spacing: str | None) -> None: ...
def push_style(self, *styles: _StylesType) -> None: ...
def pop_style(self, n: int = ...) -> None: ...
def assert_line_data(self, flag: int = ...) -> None: ...
def pop_style(self, n: int = 1) -> None: ...
def assert_line_data(self, flag: int = 1) -> None: ...
class NullWriter:
def flush(self) -> None: ...
@@ -82,7 +82,7 @@ class AbstractWriter(NullWriter): ...
class DumbWriter(NullWriter):
file: IO[str]
maxcol: int
def __init__(self, file: IO[str] | None = ..., maxcol: int = ...) -> None: ...
def __init__(self, file: IO[str] | None = None, maxcol: int = 72) -> None: ...
def reset(self) -> None: ...
def test(file: str | None = ...) -> None: ...
def test(file: str | None = None) -> None: ...