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

@@ -21,5 +21,5 @@ class DecompressReader(RawIOBase):
**decomp_args: Any,
) -> None: ...
def readinto(self, b: WriteableBuffer) -> int: ...
def read(self, size: int = ...) -> bytes: ...
def seek(self, offset: int, whence: int = ...) -> int: ...
def read(self, size: int = -1) -> bytes: ...
def seek(self, offset: int, whence: int = 0) -> int: ...

View File

@@ -345,7 +345,7 @@ if sys.platform != "win32":
def set_tabsize(__size: int) -> None: ...
def setsyx(__y: int, __x: int) -> None: ...
def setupterm(term: str | None = ..., fd: int = ...) -> None: ...
def setupterm(term: str | None = None, fd: int = -1) -> None: ...
def start_color() -> None: ...
def termattrs() -> int: ...
def termname() -> bytes: ...

View File

@@ -53,7 +53,7 @@ def getcontext() -> Context: ...
if sys.version_info >= (3, 11):
def localcontext(
ctx: Context | None = ...,
ctx: Context | None = None,
*,
prec: int | None = ...,
rounding: str | None = ...,
@@ -73,10 +73,10 @@ class Decimal:
@classmethod
def from_float(cls: type[Self], __f: float) -> Self: ...
def __bool__(self) -> bool: ...
def compare(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
def compare(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
def as_tuple(self) -> DecimalTuple: ...
def as_integer_ratio(self) -> tuple[int, int]: ...
def to_eng_string(self, context: Context | None = ...) -> str: ...
def to_eng_string(self, context: Context | None = None) -> str: ...
def __abs__(self) -> Decimal: ...
def __add__(self, __other: _Decimal) -> Decimal: ...
def __divmod__(self, __other: _Decimal) -> tuple[Decimal, Decimal]: ...
@@ -100,7 +100,7 @@ class Decimal:
def __rtruediv__(self, __other: _Decimal) -> Decimal: ...
def __sub__(self, __other: _Decimal) -> Decimal: ...
def __truediv__(self, __other: _Decimal) -> Decimal: ...
def remainder_near(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
def remainder_near(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
def __float__(self) -> float: ...
def __int__(self) -> int: ...
def __trunc__(self) -> int: ...
@@ -116,53 +116,53 @@ class Decimal:
def __round__(self, __ndigits: int) -> Decimal: ...
def __floor__(self) -> int: ...
def __ceil__(self) -> int: ...
def fma(self, other: _Decimal, third: _Decimal, context: Context | None = ...) -> Decimal: ...
def fma(self, other: _Decimal, third: _Decimal, context: Context | None = None) -> Decimal: ...
def __rpow__(self, __other: _Decimal, __context: Context | None = ...) -> Decimal: ...
def normalize(self, context: Context | None = ...) -> Decimal: ...
def quantize(self, exp: _Decimal, rounding: str | None = ..., context: Context | None = ...) -> Decimal: ...
def same_quantum(self, other: _Decimal, context: Context | None = ...) -> bool: ...
def to_integral_exact(self, rounding: str | None = ..., context: Context | None = ...) -> Decimal: ...
def to_integral_value(self, rounding: str | None = ..., context: Context | None = ...) -> Decimal: ...
def to_integral(self, rounding: str | None = ..., context: Context | None = ...) -> Decimal: ...
def sqrt(self, context: Context | None = ...) -> Decimal: ...
def max(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
def min(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
def normalize(self, context: Context | None = None) -> Decimal: ...
def quantize(self, exp: _Decimal, rounding: str | None = None, context: Context | None = None) -> Decimal: ...
def same_quantum(self, other: _Decimal, context: Context | None = None) -> bool: ...
def to_integral_exact(self, rounding: str | None = None, context: Context | None = None) -> Decimal: ...
def to_integral_value(self, rounding: str | None = None, context: Context | None = None) -> Decimal: ...
def to_integral(self, rounding: str | None = None, context: Context | None = None) -> Decimal: ...
def sqrt(self, context: Context | None = None) -> Decimal: ...
def max(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
def min(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
def adjusted(self) -> int: ...
def canonical(self) -> Decimal: ...
def compare_signal(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
def compare_total(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
def compare_total_mag(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
def compare_signal(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
def compare_total(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
def compare_total_mag(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
def copy_abs(self) -> Decimal: ...
def copy_negate(self) -> Decimal: ...
def copy_sign(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
def exp(self, context: Context | None = ...) -> Decimal: ...
def copy_sign(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
def exp(self, context: Context | None = None) -> Decimal: ...
def is_canonical(self) -> bool: ...
def is_finite(self) -> bool: ...
def is_infinite(self) -> bool: ...
def is_nan(self) -> bool: ...
def is_normal(self, context: Context | None = ...) -> bool: ...
def is_normal(self, context: Context | None = None) -> bool: ...
def is_qnan(self) -> bool: ...
def is_signed(self) -> bool: ...
def is_snan(self) -> bool: ...
def is_subnormal(self, context: Context | None = ...) -> bool: ...
def is_subnormal(self, context: Context | None = None) -> bool: ...
def is_zero(self) -> bool: ...
def ln(self, context: Context | None = ...) -> Decimal: ...
def log10(self, context: Context | None = ...) -> Decimal: ...
def logb(self, context: Context | None = ...) -> Decimal: ...
def logical_and(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
def logical_invert(self, context: Context | None = ...) -> Decimal: ...
def logical_or(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
def logical_xor(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
def max_mag(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
def min_mag(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
def next_minus(self, context: Context | None = ...) -> Decimal: ...
def next_plus(self, context: Context | None = ...) -> Decimal: ...
def next_toward(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
def number_class(self, context: Context | None = ...) -> str: ...
def ln(self, context: Context | None = None) -> Decimal: ...
def log10(self, context: Context | None = None) -> Decimal: ...
def logb(self, context: Context | None = None) -> Decimal: ...
def logical_and(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
def logical_invert(self, context: Context | None = None) -> Decimal: ...
def logical_or(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
def logical_xor(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
def max_mag(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
def min_mag(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
def next_minus(self, context: Context | None = None) -> Decimal: ...
def next_plus(self, context: Context | None = None) -> Decimal: ...
def next_toward(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
def number_class(self, context: Context | None = None) -> str: ...
def radix(self) -> Decimal: ...
def rotate(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
def scaleb(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
def shift(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
def rotate(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
def scaleb(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
def shift(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
def __reduce__(self: Self) -> tuple[type[Self], tuple[str]]: ...
def __copy__(self: Self) -> Self: ...
def __deepcopy__(self: Self, __memo: Any) -> Self: ...
@@ -259,7 +259,7 @@ class Context:
def normalize(self, __x: _Decimal) -> Decimal: ...
def number_class(self, __x: _Decimal) -> str: ...
def plus(self, __x: _Decimal) -> Decimal: ...
def power(self, a: _Decimal, b: _Decimal, modulo: _Decimal | None = ...) -> Decimal: ...
def power(self, a: _Decimal, b: _Decimal, modulo: _Decimal | None = None) -> Decimal: ...
def quantize(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def radix(self) -> Decimal: ...
def remainder(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...

View File

@@ -21,7 +21,7 @@ def lock_held() -> bool: ...
def release_lock() -> None: ...
if sys.version_info >= (3, 11):
def find_frozen(__name: str, *, withdata: bool = ...) -> tuple[memoryview | None, bool, str | None] | None: ...
def find_frozen(__name: str, *, withdata: bool = False) -> tuple[memoryview | None, bool, str | None] | None: ...
def get_frozen_object(__name: str, __data: ReadableBuffer | None = ...) -> types.CodeType: ...
else:

View File

@@ -5,9 +5,9 @@ class ParserBase:
def reset(self) -> None: ...
def getpos(self) -> tuple[int, int]: ...
def unknown_decl(self, data: str) -> None: ...
def parse_comment(self, i: int, report: int = ...) -> int: ... # undocumented
def parse_comment(self, i: int, report: int = 1) -> int: ... # undocumented
def parse_declaration(self, i: int) -> int: ... # undocumented
def parse_marked_section(self, i: int, report: int = ...) -> int: ... # undocumented
def parse_marked_section(self, i: int, report: int = 1) -> int: ... # undocumented
def updatepos(self, i: int, j: int) -> int: ... # undocumented
if sys.version_info < (3, 10):
# Removed from ParserBase: https://bugs.python.org/issue31844

View File

@@ -12,10 +12,10 @@ _UNIVERSAL_CONFIG_VARS: tuple[str, ...] # undocumented
_COMPILER_CONFIG_VARS: tuple[str, ...] # undocumented
_INITPRE: str # undocumented
def _find_executable(executable: str, path: str | None = ...) -> str | None: ... # undocumented
def _find_executable(executable: str, path: str | None = None) -> str | None: ... # undocumented
if sys.version_info >= (3, 8):
def _read_output(commandstring: str, capture_stderr: bool = ...) -> str | None: ... # undocumented
def _read_output(commandstring: str, capture_stderr: bool = False) -> str | None: ... # undocumented
else:
def _read_output(commandstring: str) -> str | None: ... # undocumented

View File

@@ -6,7 +6,7 @@ class Quitter:
name: str
eof: str
def __init__(self, name: str, eof: str) -> None: ...
def __call__(self, code: int | None = ...) -> NoReturn: ...
def __call__(self, code: int | None = None) -> NoReturn: ...
class _Printer:
MAXLINES: ClassVar[Literal[23]]

View File

@@ -20,7 +20,7 @@ class ABCMeta(type):
def __instancecheck__(cls: ABCMeta, instance: Any) -> bool: ...
def __subclasscheck__(cls: ABCMeta, subclass: type) -> bool: ...
def _dump_registry(cls: ABCMeta, file: SupportsWrite[str] | None = ...) -> None: ...
def _dump_registry(cls: ABCMeta, file: SupportsWrite[str] | None = None) -> None: ...
def register(cls: ABCMeta, subclass: type[_T]) -> type[_T]: ...
def abstractmethod(funcobj: _FuncT) -> _FuncT: ...

View File

@@ -78,7 +78,7 @@ class _ActionsContainer:
_has_negative_number_optionals: list[bool]
def __init__(self, description: str | None, prefix_chars: str, argument_default: Any, conflict_handler: str) -> None: ...
def register(self, registry_name: str, value: Any, object: Any) -> None: ...
def _registry_get(self, registry_name: str, value: Any, default: Any = ...) -> Any: ...
def _registry_get(self, registry_name: str, value: Any, default: Any = None) -> Any: ...
def set_defaults(self, **kwargs: Any) -> None: ...
def get_default(self, dest: str) -> Any: ...
def add_argument(
@@ -104,7 +104,7 @@ class _ActionsContainer:
def _add_container_actions(self, container: _ActionsContainer) -> None: ...
def _get_positional_kwargs(self, dest: str, **kwargs: Any) -> dict[str, Any]: ...
def _get_optional_kwargs(self, *args: Any, **kwargs: Any) -> dict[str, Any]: ...
def _pop_action_class(self, kwargs: Any, default: type[Action] | None = ...) -> type[Action]: ...
def _pop_action_class(self, kwargs: Any, default: type[Action] | None = None) -> type[Action]: ...
def _get_handler(self) -> Callable[[Action, Iterable[tuple[str, Action]]], Any]: ...
def _check_conflict(self, action: Action) -> None: ...
def _handle_conflict_error(self, action: Action, conflicting_actions: Iterable[tuple[str, Action]]) -> NoReturn: ...
@@ -131,19 +131,19 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
if sys.version_info >= (3, 9):
def __init__(
self,
prog: str | None = ...,
usage: str | None = ...,
description: str | None = ...,
epilog: str | None = ...,
prog: str | None = None,
usage: str | None = None,
description: str | None = None,
epilog: str | None = None,
parents: Sequence[ArgumentParser] = ...,
formatter_class: _FormatterClass = ...,
prefix_chars: str = ...,
fromfile_prefix_chars: str | None = ...,
argument_default: Any = ...,
conflict_handler: str = ...,
add_help: bool = ...,
allow_abbrev: bool = ...,
exit_on_error: bool = ...,
prefix_chars: str = "-",
fromfile_prefix_chars: str | None = None,
argument_default: Any = None,
conflict_handler: str = "error",
add_help: bool = True,
allow_abbrev: bool = True,
exit_on_error: bool = True,
) -> None: ...
else:
def __init__(
@@ -202,19 +202,19 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
help: str | None = ...,
metavar: str | None = ...,
) -> _SubParsersAction[_ArgumentParserT]: ...
def print_usage(self, file: IO[str] | None = ...) -> None: ...
def print_help(self, file: IO[str] | None = ...) -> None: ...
def print_usage(self, file: IO[str] | None = None) -> None: ...
def print_help(self, file: IO[str] | None = None) -> None: ...
def format_usage(self) -> str: ...
def format_help(self) -> str: ...
def parse_known_args(
self, args: Sequence[str] | None = ..., namespace: Namespace | None = ...
self, args: Sequence[str] | None = None, namespace: Namespace | None = None
) -> tuple[Namespace, list[str]]: ...
def convert_arg_line_to_args(self, arg_line: str) -> list[str]: ...
def exit(self, status: int = ..., message: str | None = ...) -> NoReturn: ...
def exit(self, status: int = 0, message: str | None = None) -> NoReturn: ...
def error(self, message: str) -> NoReturn: ...
def parse_intermixed_args(self, args: Sequence[str] | None = ..., namespace: Namespace | None = ...) -> Namespace: ...
def parse_intermixed_args(self, args: Sequence[str] | None = None, namespace: Namespace | None = None) -> Namespace: ...
def parse_known_intermixed_args(
self, args: Sequence[str] | None = ..., namespace: Namespace | None = ...
self, args: Sequence[str] | None = None, namespace: Namespace | None = None
) -> tuple[Namespace, list[str]]: ...
# undocumented
def _get_optional_actions(self) -> list[Action]: ...
@@ -230,7 +230,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
def _get_value(self, action: Action, arg_string: str) -> Any: ...
def _check_value(self, action: Action, value: Any) -> None: ...
def _get_formatter(self) -> HelpFormatter: ...
def _print_message(self, message: str, file: IO[str] | None = ...) -> None: ...
def _print_message(self, message: str, file: IO[str] | None = None) -> None: ...
class HelpFormatter:
# undocumented
@@ -246,7 +246,7 @@ class HelpFormatter:
_whitespace_matcher: Pattern[str]
_long_break_matcher: Pattern[str]
_Section: type[Any] # Nested class
def __init__(self, prog: str, indent_increment: int = ..., max_help_position: int = ..., width: int | None = ...) -> None: ...
def __init__(self, prog: str, indent_increment: int = 2, max_help_position: int = 24, width: int | None = None) -> None: ...
def _indent(self) -> None: ...
def _dedent(self) -> None: ...
def _add_item(self, func: Callable[..., str], args: Iterable[Any]) -> None: ...
@@ -254,7 +254,7 @@ class HelpFormatter:
def end_section(self) -> None: ...
def add_text(self, text: str | None) -> None: ...
def add_usage(
self, usage: str | None, actions: Iterable[Action], groups: Iterable[_ArgumentGroup], prefix: str | None = ...
self, usage: str | None, actions: Iterable[Action], groups: Iterable[_ArgumentGroup], prefix: str | None = None
) -> None: ...
def add_argument(self, action: Action) -> None: ...
def add_arguments(self, actions: Iterable[Action]) -> None: ...
@@ -297,17 +297,17 @@ class Action(_AttributeHolder):
self,
option_strings: Sequence[str],
dest: str,
nargs: int | str | None = ...,
const: _T | None = ...,
default: _T | str | None = ...,
type: Callable[[str], _T] | FileType | None = ...,
choices: Iterable[_T] | None = ...,
required: bool = ...,
help: str | None = ...,
metavar: str | tuple[str, ...] | None = ...,
nargs: int | str | None = None,
const: _T | None = None,
default: _T | str | None = None,
type: Callable[[str], _T] | FileType | None = None,
choices: Iterable[_T] | None = None,
required: bool = False,
help: str | None = None,
metavar: str | tuple[str, ...] | None = None,
) -> None: ...
def __call__(
self, parser: ArgumentParser, namespace: Namespace, values: str | Sequence[Any] | None, option_string: str | None = ...
self, parser: ArgumentParser, namespace: Namespace, values: str | Sequence[Any] | None, option_string: str | None = None
) -> None: ...
if sys.version_info >= (3, 9):
def format_usage(self) -> str: ...
@@ -318,12 +318,12 @@ if sys.version_info >= (3, 9):
self,
option_strings: Sequence[str],
dest: str,
default: _T | str | None = ...,
type: Callable[[str], _T] | FileType | None = ...,
choices: Iterable[_T] | None = ...,
required: bool = ...,
help: str | None = ...,
metavar: str | tuple[str, ...] | None = ...,
default: _T | str | None = None,
type: Callable[[str], _T] | FileType | None = None,
choices: Iterable[_T] | None = None,
required: bool = False,
help: str | None = None,
metavar: str | tuple[str, ...] | None = None,
) -> None: ...
class Namespace(_AttributeHolder):
@@ -339,7 +339,7 @@ class FileType:
_bufsize: int
_encoding: str | None
_errors: str | None
def __init__(self, mode: str = ..., bufsize: int = ..., encoding: str | None = ..., errors: str | None = ...) -> None: ...
def __init__(self, mode: str = "r", bufsize: int = -1, encoding: str | None = None, errors: str | None = None) -> None: ...
def __call__(self, string: str) -> IO[Any]: ...
# undocumented
@@ -347,14 +347,14 @@ class _ArgumentGroup(_ActionsContainer):
title: str | None
_group_actions: list[Action]
def __init__(
self, container: _ActionsContainer, title: str | None = ..., description: str | None = ..., **kwargs: Any
self, container: _ActionsContainer, title: str | None = None, description: str | None = None, **kwargs: Any
) -> None: ...
# undocumented
class _MutuallyExclusiveGroup(_ArgumentGroup):
required: bool
_container: _ActionsContainer
def __init__(self, container: _ActionsContainer, required: bool = ...) -> None: ...
def __init__(self, container: _ActionsContainer, required: bool = False) -> None: ...
# undocumented
class _StoreAction(Action): ...
@@ -366,11 +366,11 @@ class _StoreConstAction(Action):
self,
option_strings: Sequence[str],
dest: str,
const: Any | None = ...,
default: Any = ...,
required: bool = ...,
help: str | None = ...,
metavar: str | tuple[str, ...] | None = ...,
const: Any | None = None,
default: Any = None,
required: bool = False,
help: str | None = None,
metavar: str | tuple[str, ...] | None = None,
) -> None: ...
else:
def __init__(
@@ -387,13 +387,13 @@ class _StoreConstAction(Action):
# undocumented
class _StoreTrueAction(_StoreConstAction):
def __init__(
self, option_strings: Sequence[str], dest: str, default: bool = ..., required: bool = ..., help: str | None = ...
self, option_strings: Sequence[str], dest: str, default: bool = False, required: bool = False, help: str | None = None
) -> None: ...
# undocumented
class _StoreFalseAction(_StoreConstAction):
def __init__(
self, option_strings: Sequence[str], dest: str, default: bool = ..., required: bool = ..., help: str | None = ...
self, option_strings: Sequence[str], dest: str, default: bool = True, required: bool = False, help: str | None = None
) -> None: ...
# undocumented
@@ -410,11 +410,11 @@ class _AppendConstAction(Action):
self,
option_strings: Sequence[str],
dest: str,
const: Any | None = ...,
default: Any = ...,
required: bool = ...,
help: str | None = ...,
metavar: str | tuple[str, ...] | None = ...,
const: Any | None = None,
default: Any = None,
required: bool = False,
help: str | None = None,
metavar: str | tuple[str, ...] | None = None,
) -> None: ...
else:
def __init__(
@@ -431,18 +431,25 @@ class _AppendConstAction(Action):
# undocumented
class _CountAction(Action):
def __init__(
self, option_strings: Sequence[str], dest: str, default: Any = ..., required: bool = ..., help: str | None = ...
self, option_strings: Sequence[str], dest: str, default: Any = None, required: bool = False, help: str | None = None
) -> None: ...
# undocumented
class _HelpAction(Action):
def __init__(self, option_strings: Sequence[str], dest: str = ..., default: str = ..., help: str | None = ...) -> None: ...
def __init__(
self, option_strings: Sequence[str], dest: str = "==SUPPRESS==", default: str = "==SUPPRESS==", help: str | None = None
) -> None: ...
# undocumented
class _VersionAction(Action):
version: str | None
def __init__(
self, option_strings: Sequence[str], version: str | None = ..., dest: str = ..., default: str = ..., help: str = ...
self,
option_strings: Sequence[str],
version: str | None = None,
dest: str = "==SUPPRESS==",
default: str = "==SUPPRESS==",
help: str = "show program's version number and exit",
) -> None: ...
# undocumented
@@ -458,10 +465,10 @@ class _SubParsersAction(Action, Generic[_ArgumentParserT]):
option_strings: Sequence[str],
prog: str,
parser_class: type[_ArgumentParserT],
dest: str = ...,
required: bool = ...,
help: str | None = ...,
metavar: str | tuple[str, ...] | None = ...,
dest: str = "==SUPPRESS==",
required: bool = False,
help: str | None = None,
metavar: str | tuple[str, ...] | None = None,
) -> None: ...
# Note: `add_parser` accepts all kwargs of `ArgumentParser.__init__`. It also

View File

@@ -268,21 +268,21 @@ def copy_location(new_node: _T, old_node: AST) -> _T: ...
if sys.version_info >= (3, 9):
def dump(
node: AST, annotate_fields: bool = ..., include_attributes: bool = ..., *, indent: int | str | None = ...
node: AST, annotate_fields: bool = True, include_attributes: bool = False, *, indent: int | str | None = None
) -> str: ...
else:
def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ...
def fix_missing_locations(node: _T) -> _T: ...
def get_docstring(node: AsyncFunctionDef | FunctionDef | ClassDef | Module, clean: bool = ...) -> str | None: ...
def increment_lineno(node: _T, n: int = ...) -> _T: ...
def get_docstring(node: AsyncFunctionDef | FunctionDef | ClassDef | Module, clean: bool = True) -> str | None: ...
def increment_lineno(node: _T, n: int = 1) -> _T: ...
def iter_child_nodes(node: AST) -> Iterator[AST]: ...
def iter_fields(node: AST) -> Iterator[tuple[str, Any]]: ...
def literal_eval(node_or_string: str | AST) -> Any: ...
if sys.version_info >= (3, 8):
def get_source_segment(source: str, node: AST, *, padded: bool = ...) -> str | None: ...
def get_source_segment(source: str, node: AST, *, padded: bool = False) -> str | None: ...
def walk(node: AST) -> Iterator[AST]: ...

View File

@@ -2,7 +2,7 @@ import asyncore
from abc import abstractmethod
class simple_producer:
def __init__(self, data: bytes, buffer_size: int = ...) -> None: ...
def __init__(self, data: bytes, buffer_size: int = 512) -> None: ...
def more(self) -> bytes: ...
class async_chat(asyncore.dispatcher):

View File

@@ -34,7 +34,7 @@ class Server(AbstractServer):
ssl_context: _SSLContext,
backlog: int,
ssl_handshake_timeout: float | None,
ssl_shutdown_timeout: float | None = ...,
ssl_shutdown_timeout: float | None = None,
) -> None: ...
else:
def __init__(
@@ -74,18 +74,20 @@ class BaseEventLoop(AbstractEventLoop):
def close(self) -> None: ...
async def shutdown_asyncgens(self) -> None: ...
# Methods scheduling callbacks. All these return Handles.
def call_soon(self, callback: Callable[..., object], *args: Any, context: Context | None = ...) -> Handle: ...
def call_soon(self, callback: Callable[..., object], *args: Any, context: Context | None = None) -> Handle: ...
def call_later(
self, delay: float, callback: Callable[..., object], *args: Any, context: Context | None = ...
self, delay: float, callback: Callable[..., object], *args: Any, context: Context | None = None
) -> TimerHandle: ...
def call_at(
self, when: float, callback: Callable[..., object], *args: Any, context: Context | None = None
) -> TimerHandle: ...
def call_at(self, when: float, callback: Callable[..., object], *args: Any, context: Context | None = ...) -> TimerHandle: ...
def time(self) -> float: ...
# Future methods
def create_future(self) -> Future[Any]: ...
# Tasks methods
if sys.version_info >= (3, 11):
def create_task(
self, coro: Coroutine[Any, Any, _T] | Generator[Any, None, _T], *, name: object = ..., context: Context | None = ...
self, coro: Coroutine[Any, Any, _T] | Generator[Any, None, _T], *, name: object = None, context: Context | None = None
) -> Task[_T]: ...
elif sys.version_info >= (3, 8):
def create_task(self, coro: Coroutine[Any, Any, _T] | Generator[Any, None, _T], *, name: object = ...) -> Task[_T]: ...
@@ -95,7 +97,7 @@ class BaseEventLoop(AbstractEventLoop):
def set_task_factory(self, factory: _TaskFactory | None) -> None: ...
def get_task_factory(self) -> _TaskFactory | None: ...
# Methods for interacting with threads
def call_soon_threadsafe(self, callback: Callable[..., object], *args: Any, context: Context | None = ...) -> Handle: ...
def call_soon_threadsafe(self, callback: Callable[..., object], *args: Any, context: Context | None = None) -> Handle: ...
def run_in_executor(self, executor: Any, func: Callable[..., _T], *args: Any) -> Future[_T]: ...
def set_default_executor(self, executor: Any) -> None: ...
# Network I/O methods returning Futures.
@@ -104,12 +106,12 @@ class BaseEventLoop(AbstractEventLoop):
host: bytes | str | None,
port: bytes | str | int | None,
*,
family: int = ...,
type: int = ...,
proto: int = ...,
flags: int = ...,
family: int = 0,
type: int = 0,
proto: int = 0,
flags: int = 0,
) -> list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int]]]: ...
async def getnameinfo(self, sockaddr: tuple[str, int] | tuple[str, int, int, int], flags: int = ...) -> tuple[str, str]: ...
async def getnameinfo(self, sockaddr: tuple[str, int] | tuple[str, int, int, int], flags: int = 0) -> tuple[str, str]: ...
if sys.version_info >= (3, 11):
@overload
async def create_connection(
@@ -262,19 +264,19 @@ class BaseEventLoop(AbstractEventLoop):
protocol: BaseProtocol,
sslcontext: ssl.SSLContext,
*,
server_side: bool = ...,
server_hostname: str | None = ...,
ssl_handshake_timeout: float | None = ...,
ssl_shutdown_timeout: float | None = ...,
server_side: bool = False,
server_hostname: str | None = None,
ssl_handshake_timeout: float | None = None,
ssl_shutdown_timeout: float | None = None,
) -> Transport: ...
async def connect_accepted_socket(
self,
protocol_factory: Callable[[], _ProtocolT],
sock: socket,
*,
ssl: _SSLContext = ...,
ssl_handshake_timeout: float | None = ...,
ssl_shutdown_timeout: float | None = ...,
ssl: _SSLContext = None,
ssl_handshake_timeout: float | None = None,
ssl_shutdown_timeout: float | None = None,
) -> tuple[Transport, _ProtocolT]: ...
else:
@overload
@@ -331,24 +333,24 @@ class BaseEventLoop(AbstractEventLoop):
) -> tuple[Transport, _ProtocolT]: ...
async def sock_sendfile(
self, sock: socket, file: IO[bytes], offset: int = ..., count: int | None = ..., *, fallback: bool | None = ...
self, sock: socket, file: IO[bytes], offset: int = 0, count: int | None = None, *, fallback: bool | None = True
) -> int: ...
async def sendfile(
self, transport: WriteTransport, file: IO[bytes], offset: int = ..., count: int | None = ..., *, fallback: bool = ...
self, transport: WriteTransport, file: IO[bytes], offset: int = 0, count: int | None = None, *, fallback: bool = True
) -> int: ...
if sys.version_info >= (3, 11):
async def create_datagram_endpoint( # type: ignore[override]
self,
protocol_factory: Callable[[], _ProtocolT],
local_addr: tuple[str, int] | None = ...,
remote_addr: tuple[str, int] | None = ...,
local_addr: tuple[str, int] | None = None,
remote_addr: tuple[str, int] | None = None,
*,
family: int = ...,
proto: int = ...,
flags: int = ...,
reuse_port: bool | None = ...,
allow_broadcast: bool | None = ...,
sock: socket | None = ...,
family: int = 0,
proto: int = 0,
flags: int = 0,
reuse_port: bool | None = None,
allow_broadcast: bool | None = None,
sock: socket | None = None,
) -> tuple[DatagramTransport, _ProtocolT]: ...
else:
async def create_datagram_endpoint(
@@ -377,15 +379,15 @@ class BaseEventLoop(AbstractEventLoop):
protocol_factory: Callable[[], _ProtocolT],
cmd: bytes | str,
*,
stdin: int | IO[Any] | None = ...,
stdout: int | IO[Any] | None = ...,
stderr: int | IO[Any] | None = ...,
universal_newlines: Literal[False] = ...,
shell: Literal[True] = ...,
bufsize: Literal[0] = ...,
encoding: None = ...,
errors: None = ...,
text: Literal[False, None] = ...,
stdin: int | IO[Any] | None = -1,
stdout: int | IO[Any] | None = -1,
stderr: int | IO[Any] | None = -1,
universal_newlines: Literal[False] = False,
shell: Literal[True] = True,
bufsize: Literal[0] = 0,
encoding: None = None,
errors: None = None,
text: Literal[False, None] = None,
**kwargs: Any,
) -> tuple[SubprocessTransport, _ProtocolT]: ...
async def subprocess_exec(
@@ -393,14 +395,14 @@ class BaseEventLoop(AbstractEventLoop):
protocol_factory: Callable[[], _ProtocolT],
program: Any,
*args: Any,
stdin: int | IO[Any] | None = ...,
stdout: int | IO[Any] | None = ...,
stderr: int | IO[Any] | None = ...,
universal_newlines: Literal[False] = ...,
stdin: int | IO[Any] | None = -1,
stdout: int | IO[Any] | None = -1,
stderr: int | IO[Any] | None = -1,
universal_newlines: Literal[False] = False,
shell: Literal[True] = ...,
bufsize: Literal[0] = ...,
encoding: None = ...,
errors: None = ...,
bufsize: Literal[0] = 0,
encoding: None = None,
errors: None = None,
**kwargs: Any,
) -> tuple[SubprocessTransport, _ProtocolT]: ...
def add_reader(self, fd: FileDescriptorLike, callback: Callable[..., Any], *args: Any) -> None: ...
@@ -416,7 +418,7 @@ class BaseEventLoop(AbstractEventLoop):
async def sock_accept(self, sock: socket) -> tuple[socket, _RetAddress]: ...
if sys.version_info >= (3, 11):
async def sock_recvfrom(self, sock: socket, bufsize: int) -> bytes: ...
async def sock_recvfrom_into(self, sock: socket, buf: WriteableBuffer, nbytes: int = ...) -> int: ...
async def sock_recvfrom_into(self, sock: socket, buf: WriteableBuffer, nbytes: int = 0) -> int: ...
async def sock_sendto(self, sock: socket, data: ReadableBuffer, address: _Address) -> None: ...
# Signal handling.
def add_signal_handler(self, sig: int, callback: Callable[..., Any], *args: Any) -> None: ...

View File

@@ -30,8 +30,8 @@ class BaseSubprocessTransport(transports.SubprocessTransport):
stdout: _File,
stderr: _File,
bufsize: int,
waiter: futures.Future[Any] | None = ...,
extra: Any | None = ...,
waiter: futures.Future[Any] | None = None,
extra: Any | None = None,
**kwargs: Any,
) -> None: ...
def _start(

View File

@@ -70,7 +70,7 @@ class Handle:
_cancelled: bool
_args: Sequence[Any]
def __init__(
self, callback: Callable[..., object], args: Sequence[Any], loop: AbstractEventLoop, context: Context | None = ...
self, callback: Callable[..., object], args: Sequence[Any], loop: AbstractEventLoop, context: Context | None = None
) -> None: ...
def cancel(self) -> None: ...
def _run(self) -> None: ...
@@ -83,7 +83,7 @@ class TimerHandle(Handle):
callback: Callable[..., object],
args: Sequence[Any],
loop: AbstractEventLoop,
context: Context | None = ...,
context: Context | None = None,
) -> None: ...
def when(self) -> float: ...
def __lt__(self, other: TimerHandle) -> bool: ...
@@ -132,14 +132,14 @@ class AbstractEventLoop:
# Methods scheduling callbacks. All these return Handles.
if sys.version_info >= (3, 9): # "context" added in 3.9.10/3.10.2
@abstractmethod
def call_soon(self, callback: Callable[..., object], *args: Any, context: Context | None = ...) -> Handle: ...
def call_soon(self, callback: Callable[..., object], *args: Any, context: Context | None = None) -> Handle: ...
@abstractmethod
def call_later(
self, delay: float, callback: Callable[..., object], *args: Any, context: Context | None = ...
self, delay: float, callback: Callable[..., object], *args: Any, context: Context | None = None
) -> TimerHandle: ...
@abstractmethod
def call_at(
self, when: float, callback: Callable[..., object], *args: Any, context: Context | None = ...
self, when: float, callback: Callable[..., object], *args: Any, context: Context | None = None
) -> TimerHandle: ...
else:
@abstractmethod
@@ -161,8 +161,8 @@ class AbstractEventLoop:
self,
coro: Coroutine[Any, Any, _T] | Generator[Any, None, _T],
*,
name: str | None = ...,
context: Context | None = ...,
name: str | None = None,
context: Context | None = None,
) -> Task[_T]: ...
elif sys.version_info >= (3, 8):
@abstractmethod
@@ -180,7 +180,7 @@ class AbstractEventLoop:
# Methods for interacting with threads
if sys.version_info >= (3, 9): # "context" added in 3.9.10/3.10.2
@abstractmethod
def call_soon_threadsafe(self, callback: Callable[..., object], *args: Any, context: Context | None = ...) -> Handle: ...
def call_soon_threadsafe(self, callback: Callable[..., object], *args: Any, context: Context | None = None) -> Handle: ...
else:
@abstractmethod
def call_soon_threadsafe(self, callback: Callable[..., object], *args: Any) -> Handle: ...
@@ -196,13 +196,13 @@ class AbstractEventLoop:
host: bytes | str | None,
port: bytes | str | int | None,
*,
family: int = ...,
type: int = ...,
proto: int = ...,
flags: int = ...,
family: int = 0,
type: int = 0,
proto: int = 0,
flags: int = 0,
) -> list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int]]]: ...
@abstractmethod
async def getnameinfo(self, sockaddr: tuple[str, int] | tuple[str, int, int, int], flags: int = ...) -> tuple[str, str]: ...
async def getnameinfo(self, sockaddr: tuple[str, int] | tuple[str, int, int, int], flags: int = 0) -> tuple[str, str]: ...
if sys.version_info >= (3, 11):
@overload
@abstractmethod
@@ -364,22 +364,22 @@ class AbstractEventLoop:
protocol: BaseProtocol,
sslcontext: ssl.SSLContext,
*,
server_side: bool = ...,
server_hostname: str | None = ...,
ssl_handshake_timeout: float | None = ...,
ssl_shutdown_timeout: float | None = ...,
server_side: bool = False,
server_hostname: str | None = None,
ssl_handshake_timeout: float | None = None,
ssl_shutdown_timeout: float | None = None,
) -> Transport: ...
async def create_unix_server(
self,
protocol_factory: _ProtocolFactory,
path: StrPath | None = ...,
path: StrPath | None = None,
*,
sock: socket | None = ...,
backlog: int = ...,
ssl: _SSLContext = ...,
ssl_handshake_timeout: float | None = ...,
ssl_shutdown_timeout: float | None = ...,
start_serving: bool = ...,
sock: socket | None = None,
backlog: int = 100,
ssl: _SSLContext = None,
ssl_handshake_timeout: float | None = None,
ssl_shutdown_timeout: float | None = None,
start_serving: bool = True,
) -> Server: ...
else:
@overload
@@ -446,9 +446,9 @@ class AbstractEventLoop:
protocol_factory: Callable[[], _ProtocolT],
sock: socket,
*,
ssl: _SSLContext = ...,
ssl_handshake_timeout: float | None = ...,
ssl_shutdown_timeout: float | None = ...,
ssl: _SSLContext = None,
ssl_handshake_timeout: float | None = None,
ssl_shutdown_timeout: float | None = None,
) -> tuple[Transport, _ProtocolT]: ...
elif sys.version_info >= (3, 10):
async def connect_accepted_socket(
@@ -463,13 +463,13 @@ class AbstractEventLoop:
async def create_unix_connection(
self,
protocol_factory: Callable[[], _ProtocolT],
path: str | None = ...,
path: str | None = None,
*,
ssl: _SSLContext = ...,
sock: socket | None = ...,
server_hostname: str | None = ...,
ssl_handshake_timeout: float | None = ...,
ssl_shutdown_timeout: float | None = ...,
ssl: _SSLContext = None,
sock: socket | None = None,
server_hostname: str | None = None,
ssl_handshake_timeout: float | None = None,
ssl_shutdown_timeout: float | None = None,
) -> tuple[Transport, _ProtocolT]: ...
else:
async def create_unix_connection(
@@ -485,26 +485,26 @@ class AbstractEventLoop:
@abstractmethod
async def sock_sendfile(
self, sock: socket, file: IO[bytes], offset: int = ..., count: int | None = ..., *, fallback: bool | None = ...
self, sock: socket, file: IO[bytes], offset: int = 0, count: int | None = None, *, fallback: bool | None = None
) -> int: ...
@abstractmethod
async def sendfile(
self, transport: WriteTransport, file: IO[bytes], offset: int = ..., count: int | None = ..., *, fallback: bool = ...
self, transport: WriteTransport, file: IO[bytes], offset: int = 0, count: int | None = None, *, fallback: bool = True
) -> int: ...
@abstractmethod
async def create_datagram_endpoint(
self,
protocol_factory: Callable[[], _ProtocolT],
local_addr: tuple[str, int] | None = ...,
remote_addr: tuple[str, int] | None = ...,
local_addr: tuple[str, int] | None = None,
remote_addr: tuple[str, int] | None = None,
*,
family: int = ...,
proto: int = ...,
flags: int = ...,
reuse_address: bool | None = ...,
reuse_port: bool | None = ...,
allow_broadcast: bool | None = ...,
sock: socket | None = ...,
family: int = 0,
proto: int = 0,
flags: int = 0,
reuse_address: bool | None = None,
reuse_port: bool | None = None,
allow_broadcast: bool | None = None,
sock: socket | None = None,
) -> tuple[DatagramTransport, _ProtocolT]: ...
# Pipes and subprocesses.
@abstractmethod
@@ -521,9 +521,9 @@ class AbstractEventLoop:
protocol_factory: Callable[[], _ProtocolT],
cmd: bytes | str,
*,
stdin: int | IO[Any] | None = ...,
stdout: int | IO[Any] | None = ...,
stderr: int | IO[Any] | None = ...,
stdin: int | IO[Any] | None = -1,
stdout: int | IO[Any] | None = -1,
stderr: int | IO[Any] | None = -1,
universal_newlines: Literal[False] = ...,
shell: Literal[True] = ...,
bufsize: Literal[0] = ...,
@@ -538,9 +538,9 @@ class AbstractEventLoop:
protocol_factory: Callable[[], _ProtocolT],
program: Any,
*args: Any,
stdin: int | IO[Any] | None = ...,
stdout: int | IO[Any] | None = ...,
stderr: int | IO[Any] | None = ...,
stdin: int | IO[Any] | None = -1,
stdout: int | IO[Any] | None = -1,
stderr: int | IO[Any] | None = -1,
universal_newlines: Literal[False] = ...,
shell: Literal[True] = ...,
bufsize: Literal[0] = ...,
@@ -571,7 +571,7 @@ class AbstractEventLoop:
@abstractmethod
async def sock_recvfrom(self, sock: socket, bufsize: int) -> bytes: ...
@abstractmethod
async def sock_recvfrom_into(self, sock: socket, buf: WriteableBuffer, nbytes: int = ...) -> int: ...
async def sock_recvfrom_into(self, sock: socket, buf: WriteableBuffer, nbytes: int = 0) -> int: ...
@abstractmethod
async def sock_sendto(self, sock: socket, data: ReadableBuffer, address: _Address) -> None: ...
# Signal handling.

View File

@@ -16,5 +16,5 @@ def _get_function_source(func: _FuncType) -> tuple[str, int]: ...
def _get_function_source(func: object) -> tuple[str, int] | None: ...
def _format_callback_source(func: object, args: Iterable[Any]) -> str: ...
def _format_args_and_kwargs(args: Iterable[Any], kwargs: dict[str, Any]) -> str: ...
def _format_callback(func: object, args: Iterable[Any], kwargs: dict[str, Any], suffix: str = ...) -> str: ...
def extract_stack(f: FrameType | None = ..., limit: int | None = ...) -> traceback.StackSummary: ...
def _format_callback(func: object, args: Iterable[Any], kwargs: dict[str, Any], suffix: str = "") -> str: ...
def extract_stack(f: FrameType | None = None, limit: int | None = None) -> traceback.StackSummary: ...

View File

@@ -46,7 +46,7 @@ class Future(Awaitable[_T], Iterable[_T]):
def _callbacks(self: Self) -> list[tuple[Callable[[Self], Any], Context]]: ...
def add_done_callback(self: Self, __fn: Callable[[Self], object], *, context: Context | None = ...) -> None: ...
if sys.version_info >= (3, 9):
def cancel(self, msg: Any | None = ...) -> bool: ...
def cancel(self, msg: Any | None = None) -> bool: ...
else:
def cancel(self) -> bool: ...
@@ -64,4 +64,4 @@ class Future(Awaitable[_T], Iterable[_T]):
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def wrap_future(future: _ConcurrentFuture[_T] | Future[_T], *, loop: AbstractEventLoop | None = ...) -> Future[_T]: ...
def wrap_future(future: _ConcurrentFuture[_T] | Future[_T], *, loop: AbstractEventLoop | None = None) -> Future[_T]: ...

View File

@@ -67,7 +67,7 @@ class Event:
class Condition(_ContextManagerMixin):
if sys.version_info >= (3, 11):
def __init__(self, lock: Lock | None = ...) -> None: ...
def __init__(self, lock: Lock | None = None) -> None: ...
else:
def __init__(self, lock: Lock | None = ..., *, loop: AbstractEventLoop | None = ...) -> None: ...
@@ -76,14 +76,14 @@ class Condition(_ContextManagerMixin):
def release(self) -> None: ...
async def wait(self) -> Literal[True]: ...
async def wait_for(self, predicate: Callable[[], _T]) -> _T: ...
def notify(self, n: int = ...) -> None: ...
def notify(self, n: int = 1) -> None: ...
def notify_all(self) -> None: ...
class Semaphore(_ContextManagerMixin):
_value: int
_waiters: deque[Future[Any]]
if sys.version_info >= (3, 11):
def __init__(self, value: int = ...) -> None: ...
def __init__(self, value: int = 1) -> None: ...
else:
def __init__(self, value: int = ..., *, loop: AbstractEventLoop | None = ...) -> None: ...

View File

@@ -20,9 +20,9 @@ class _ProactorBasePipeTransport(transports._FlowControlMixin, transports.BaseTr
loop: events.AbstractEventLoop,
sock: socket,
protocol: streams.StreamReaderProtocol,
waiter: futures.Future[Any] | None = ...,
extra: Mapping[Any, Any] | None = ...,
server: events.AbstractServer | None = ...,
waiter: futures.Future[Any] | None = None,
extra: Mapping[Any, Any] | None = None,
server: events.AbstractServer | None = None,
) -> None: ...
if sys.version_info >= (3, 8):
def __del__(self, _warn: _WarnCallbackProtocol = ...) -> None: ...
@@ -36,10 +36,10 @@ class _ProactorReadPipeTransport(_ProactorBasePipeTransport, transports.ReadTran
loop: events.AbstractEventLoop,
sock: socket,
protocol: streams.StreamReaderProtocol,
waiter: futures.Future[Any] | None = ...,
extra: Mapping[Any, Any] | None = ...,
server: events.AbstractServer | None = ...,
buffer_size: int = ...,
waiter: futures.Future[Any] | None = None,
extra: Mapping[Any, Any] | None = None,
server: events.AbstractServer | None = None,
buffer_size: int = 65536,
) -> None: ...
else:
def __init__(
@@ -64,9 +64,9 @@ class _ProactorSocketTransport(_ProactorReadPipeTransport, _ProactorBaseWritePip
loop: events.AbstractEventLoop,
sock: socket,
protocol: streams.StreamReaderProtocol,
waiter: futures.Future[Any] | None = ...,
extra: Mapping[Any, Any] | None = ...,
server: events.AbstractServer | None = ...,
waiter: futures.Future[Any] | None = None,
extra: Mapping[Any, Any] | None = None,
server: events.AbstractServer | None = None,
) -> None: ...
def _set_extra(self, sock: socket) -> None: ...
def can_write_eof(self) -> Literal[True]: ...

View File

@@ -14,7 +14,7 @@ _T = TypeVar("_T")
class Queue(Generic[_T]):
if sys.version_info >= (3, 11):
def __init__(self, maxsize: int = ...) -> None: ...
def __init__(self, maxsize: int = 0) -> None: ...
else:
def __init__(self, maxsize: int = ..., *, loop: AbstractEventLoop | None = ...) -> None: ...

View File

@@ -16,12 +16,12 @@ _T = TypeVar("_T")
if sys.version_info >= (3, 11):
@final
class Runner:
def __init__(self, *, debug: bool | None = ..., loop_factory: Callable[[], AbstractEventLoop] | None = ...) -> None: ...
def __init__(self, *, debug: bool | None = None, loop_factory: Callable[[], AbstractEventLoop] | None = None) -> None: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, exc_type: Unused, exc_val: Unused, exc_tb: Unused) -> None: ...
def close(self) -> None: ...
def get_loop(self) -> AbstractEventLoop: ...
def run(self, coro: Coroutine[Any, Any, _T], *, context: Context | None = ...) -> _T: ...
def run(self, coro: Coroutine[Any, Any, _T], *, context: Context | None = None) -> _T: ...
if sys.version_info >= (3, 12):
def run(
@@ -29,7 +29,7 @@ if sys.version_info >= (3, 12):
) -> _T: ...
elif sys.version_info >= (3, 8):
def run(main: Coroutine[Any, Any, _T], *, debug: bool | None = ...) -> _T: ...
def run(main: Coroutine[Any, Any, _T], *, debug: bool | None = None) -> _T: ...
else:
def run(main: Coroutine[Any, Any, _T], *, debug: bool = ...) -> _T: ...

View File

@@ -5,4 +5,4 @@ from . import base_events
__all__ = ("BaseSelectorEventLoop",)
class BaseSelectorEventLoop(base_events.BaseEventLoop):
def __init__(self, selector: selectors.BaseSelector | None = ...) -> None: ...
def __init__(self, selector: selectors.BaseSelector | None = None) -> None: ...

View File

@@ -71,7 +71,7 @@ class _SSLProtocolTransport(transports._FlowControlMixin, transports.Transport):
_ssl_protocol: SSLProtocol
_closed: bool
def __init__(self, loop: events.AbstractEventLoop, ssl_protocol: SSLProtocol) -> None: ...
def get_extra_info(self, name: str, default: Any | None = ...) -> dict[str, Any]: ...
def get_extra_info(self, name: str, default: Any | None = None) -> dict[str, Any]: ...
@property
def _protocol_paused(self) -> bool: ...
def write(self, data: bytes | bytearray | memoryview) -> None: ...
@@ -79,7 +79,7 @@ class _SSLProtocolTransport(transports._FlowControlMixin, transports.Transport):
if sys.version_info >= (3, 11):
def get_write_buffer_limits(self) -> tuple[int, int]: ...
def get_read_buffer_limits(self) -> tuple[int, int]: ...
def set_read_buffer_limits(self, high: int | None = ..., low: int | None = ...) -> None: ...
def set_read_buffer_limits(self, high: int | None = None, low: int | None = None) -> None: ...
def get_read_buffer_size(self) -> int: ...
if sys.version_info >= (3, 11):
@@ -118,11 +118,11 @@ class SSLProtocol(_SSLProtocolBase):
app_protocol: protocols.BaseProtocol,
sslcontext: ssl.SSLContext,
waiter: futures.Future[Any],
server_side: bool = ...,
server_hostname: str | None = ...,
call_connection_made: bool = ...,
ssl_handshake_timeout: int | None = ...,
ssl_shutdown_timeout: float | None = ...,
server_side: bool = False,
server_hostname: str | None = None,
call_connection_made: bool = True,
ssl_handshake_timeout: int | None = None,
ssl_shutdown_timeout: float | None = None,
) -> None: ...
else:
def __init__(
@@ -138,10 +138,10 @@ class SSLProtocol(_SSLProtocolBase):
) -> None: ...
def _set_app_protocol(self, app_protocol: protocols.BaseProtocol) -> None: ...
def _wakeup_waiter(self, exc: BaseException | None = ...) -> None: ...
def _wakeup_waiter(self, exc: BaseException | None = None) -> None: ...
def connection_lost(self, exc: BaseException | None) -> None: ...
def eof_received(self) -> None: ...
def _get_extra_info(self, name: str, default: Any | None = ...) -> Any: ...
def _get_extra_info(self, name: str, default: Any | None = None) -> Any: ...
def _start_shutdown(self) -> None: ...
if sys.version_info >= (3, 11):
def _write_appdata(self, list_of_data: list[bytes]) -> None: ...
@@ -151,7 +151,7 @@ class SSLProtocol(_SSLProtocolBase):
def _start_handshake(self) -> None: ...
def _check_handshake_timeout(self) -> None: ...
def _on_handshake_complete(self, handshake_exc: BaseException | None) -> None: ...
def _fatal_error(self, exc: BaseException, message: str = ...) -> None: ...
def _fatal_error(self, exc: BaseException, message: str = "Fatal error on transport") -> None: ...
def _abort(self) -> None: ...
if sys.version_info >= (3, 11):
def get_buffer(self, n: int) -> memoryview: ...

View File

@@ -6,5 +6,5 @@ from . import events
__all__ = ("staggered_race",)
async def staggered_race(
coro_fns: Iterable[Callable[[], Awaitable[Any]]], delay: float | None, *, loop: events.AbstractEventLoop | None = ...
coro_fns: Iterable[Callable[[], Awaitable[Any]]], delay: float | None, *, loop: events.AbstractEventLoop | None = None
) -> tuple[Any, int | None, list[Exception | None]]: ...

View File

@@ -59,19 +59,19 @@ if sys.version_info < (3, 8):
if sys.version_info >= (3, 10):
async def open_connection(
host: str | None = ...,
port: int | str | None = ...,
host: str | None = None,
port: int | str | None = None,
*,
limit: int = ...,
limit: int = 65536,
ssl_handshake_timeout: float | None = ...,
**kwds: Any,
) -> tuple[StreamReader, StreamWriter]: ...
async def start_server(
client_connected_cb: _ClientConnectedCallback,
host: str | Sequence[str] | None = ...,
port: int | str | None = ...,
host: str | Sequence[str] | None = None,
port: int | str | None = None,
*,
limit: int = ...,
limit: int = 65536,
ssl_handshake_timeout: float | None = ...,
**kwds: Any,
) -> Server: ...
@@ -100,10 +100,10 @@ else:
if sys.platform != "win32":
if sys.version_info >= (3, 10):
async def open_unix_connection(
path: StrPath | None = ..., *, limit: int = ..., **kwds: Any
path: StrPath | None = None, *, limit: int = 65536, **kwds: Any
) -> tuple[StreamReader, StreamWriter]: ...
async def start_unix_server(
client_connected_cb: _ClientConnectedCallback, path: StrPath | None = ..., *, limit: int = ..., **kwds: Any
client_connected_cb: _ClientConnectedCallback, path: StrPath | None = None, *, limit: int = 65536, **kwds: Any
) -> Server: ...
else:
async def open_unix_connection(
@@ -119,14 +119,14 @@ if sys.platform != "win32":
) -> Server: ...
class FlowControlMixin(protocols.Protocol):
def __init__(self, loop: events.AbstractEventLoop | None = ...) -> None: ...
def __init__(self, loop: events.AbstractEventLoop | None = None) -> None: ...
class StreamReaderProtocol(FlowControlMixin, protocols.Protocol):
def __init__(
self,
stream_reader: StreamReader,
client_connected_cb: _ClientConnectedCallback | None = ...,
loop: events.AbstractEventLoop | None = ...,
client_connected_cb: _ClientConnectedCallback | None = None,
loop: events.AbstractEventLoop | None = None,
) -> None: ...
class StreamWriter:
@@ -146,15 +146,15 @@ class StreamWriter:
def close(self) -> None: ...
def is_closing(self) -> bool: ...
async def wait_closed(self) -> None: ...
def get_extra_info(self, name: str, default: Any = ...) -> Any: ...
def get_extra_info(self, name: str, default: Any = None) -> Any: ...
async def drain(self) -> None: ...
if sys.version_info >= (3, 11):
async def start_tls(
self, sslcontext: ssl.SSLContext, *, server_hostname: str | None = ..., ssl_handshake_timeout: float | None = ...
self, sslcontext: ssl.SSLContext, *, server_hostname: str | None = None, ssl_handshake_timeout: float | None = None
) -> None: ...
class StreamReader(AsyncIterator[bytes]):
def __init__(self, limit: int = ..., loop: events.AbstractEventLoop | None = ...) -> None: ...
def __init__(self, limit: int = 65536, loop: events.AbstractEventLoop | None = None) -> None: ...
def exception(self) -> Exception: ...
def set_exception(self, exc: Exception) -> None: ...
def set_transport(self, transport: transports.BaseTransport) -> None: ...
@@ -164,7 +164,7 @@ class StreamReader(AsyncIterator[bytes]):
async def readline(self) -> bytes: ...
# Can be any buffer that supports len(); consider changing to a Protocol if PEP 688 is accepted
async def readuntil(self, separator: bytes | bytearray | memoryview = ...) -> bytes: ...
async def read(self, n: int = ...) -> bytes: ...
async def read(self, n: int = -1) -> bytes: ...
async def readexactly(self, n: int) -> bytes: ...
def __aiter__(self: Self) -> Self: ...
async def __anext__(self) -> bytes: ...

View File

@@ -38,15 +38,15 @@ class Process:
def send_signal(self, signal: int) -> None: ...
def terminate(self) -> None: ...
def kill(self) -> None: ...
async def communicate(self, input: bytes | bytearray | memoryview | None = ...) -> tuple[bytes, bytes]: ...
async def communicate(self, input: bytes | bytearray | memoryview | None = None) -> tuple[bytes, bytes]: ...
if sys.version_info >= (3, 11):
async def create_subprocess_shell(
cmd: str | bytes,
stdin: int | IO[Any] | None = ...,
stdout: int | IO[Any] | None = ...,
stderr: int | IO[Any] | None = ...,
limit: int = ...,
stdin: int | IO[Any] | None = None,
stdout: int | IO[Any] | None = None,
stderr: int | IO[Any] | None = None,
limit: int = 65536,
*,
# These parameters are forced to these values by BaseEventLoop.subprocess_shell
universal_newlines: Literal[False] = ...,
@@ -76,10 +76,10 @@ if sys.version_info >= (3, 11):
async def create_subprocess_exec(
program: _ExecArg,
*args: _ExecArg,
stdin: int | IO[Any] | None = ...,
stdout: int | IO[Any] | None = ...,
stderr: int | IO[Any] | None = ...,
limit: int = ...,
stdin: int | IO[Any] | None = None,
stdout: int | IO[Any] | None = None,
stderr: int | IO[Any] | None = None,
limit: int = 65536,
# These parameters are forced to these values by BaseEventLoop.subprocess_shell
universal_newlines: Literal[False] = ...,
shell: Literal[True] = ...,

View File

@@ -16,5 +16,5 @@ class TaskGroup:
async def __aenter__(self: Self) -> Self: ...
async def __aexit__(self, et: type[BaseException] | None, exc: BaseException | None, tb: TracebackType | None) -> None: ...
def create_task(
self, coro: Generator[Any, None, _T] | Coroutine[Any, Any, _T], *, name: str | None = ..., context: Context | None = ...
self, coro: Generator[Any, None, _T] | Coroutine[Any, Any, _T], *, name: str | None = None, context: Context | None = None
) -> Task[_T]: ...

View File

@@ -51,7 +51,7 @@ FIRST_EXCEPTION = concurrent.futures.FIRST_EXCEPTION
ALL_COMPLETED = concurrent.futures.ALL_COMPLETED
if sys.version_info >= (3, 10):
def as_completed(fs: Iterable[_FutureLike[_T]], *, timeout: float | None = ...) -> Iterator[Future[_T]]: ...
def as_completed(fs: Iterable[_FutureLike[_T]], *, timeout: float | None = None) -> Iterator[Future[_T]]: ...
else:
def as_completed(
@@ -288,8 +288,8 @@ class Task(Future[_T_co], Generic[_T_co]): # type: ignore[type-var] # pyright:
def get_name(self) -> str: ...
def set_name(self, __value: object) -> None: ...
def get_stack(self, *, limit: int | None = ...) -> list[FrameType]: ...
def print_stack(self, *, limit: int | None = ..., file: TextIO | None = ...) -> None: ...
def get_stack(self, *, limit: int | None = None) -> list[FrameType]: ...
def print_stack(self, *, limit: int | None = None, file: TextIO | None = None) -> None: ...
if sys.version_info >= (3, 11):
def cancelling(self) -> int: ...
def uncancel(self) -> int: ...
@@ -301,11 +301,11 @@ class Task(Future[_T_co], Generic[_T_co]): # type: ignore[type-var] # pyright:
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def all_tasks(loop: AbstractEventLoop | None = ...) -> set[Task[Any]]: ...
def all_tasks(loop: AbstractEventLoop | None = None) -> set[Task[Any]]: ...
if sys.version_info >= (3, 11):
def create_task(
coro: Generator[Any, None, _T] | Coroutine[Any, Any, _T], *, name: str | None = ..., context: Context | None = ...
coro: Generator[Any, None, _T] | Coroutine[Any, Any, _T], *, name: str | None = None, context: Context | None = None
) -> Task[_T]: ...
elif sys.version_info >= (3, 8):
@@ -314,7 +314,7 @@ elif sys.version_info >= (3, 8):
else:
def create_task(coro: Generator[Any, None, _T] | Coroutine[Any, Any, _T]) -> Task[_T]: ...
def current_task(loop: AbstractEventLoop | None = ...) -> Task[Any] | None: ...
def current_task(loop: AbstractEventLoop | None = None) -> Task[Any] | None: ...
def _enter_task(loop: AbstractEventLoop, task: Task[Any]) -> None: ...
def _leave_task(loop: AbstractEventLoop, task: Task[Any]) -> None: ...
def _register_task(task: Task[Any]) -> None: ...

View File

@@ -7,8 +7,8 @@ from typing import Any
__all__ = ("BaseTransport", "ReadTransport", "WriteTransport", "Transport", "DatagramTransport", "SubprocessTransport")
class BaseTransport:
def __init__(self, extra: Mapping[str, Any] | None = ...) -> None: ...
def get_extra_info(self, name: str, default: Any = ...) -> Any: ...
def __init__(self, extra: Mapping[str, Any] | None = None) -> None: ...
def get_extra_info(self, name: str, default: Any = None) -> Any: ...
def is_closing(self) -> bool: ...
def close(self) -> None: ...
def set_protocol(self, protocol: BaseProtocol) -> None: ...
@@ -20,7 +20,7 @@ class ReadTransport(BaseTransport):
def resume_reading(self) -> None: ...
class WriteTransport(BaseTransport):
def set_write_buffer_limits(self, high: int | None = ..., low: int | None = ...) -> None: ...
def set_write_buffer_limits(self, high: int | None = None, low: int | None = None) -> None: ...
def get_write_buffer_size(self) -> int: ...
def get_write_buffer_limits(self) -> tuple[int, int]: ...
def write(self, data: bytes | bytearray | memoryview) -> None: ...
@@ -32,7 +32,7 @@ class WriteTransport(BaseTransport):
class Transport(ReadTransport, WriteTransport): ...
class DatagramTransport(BaseTransport):
def sendto(self, data: bytes | bytearray | memoryview, addr: _Address | None = ...) -> None: ...
def sendto(self, data: bytes | bytearray | memoryview, addr: _Address | None = None) -> None: ...
def abort(self) -> None: ...
class SubprocessTransport(BaseTransport):
@@ -44,4 +44,4 @@ class SubprocessTransport(BaseTransport):
def kill(self) -> None: ...
class _FlowControlMixin(Transport):
def __init__(self, extra: Mapping[str, Any] | None = ..., loop: AbstractEventLoop | None = ...) -> None: ...
def __init__(self, extra: Mapping[str, Any] | None = None, loop: AbstractEventLoop | None = None) -> None: ...

View File

@@ -15,12 +15,12 @@ class ExitNow(Exception): ...
def read(obj: Any) -> None: ...
def write(obj: Any) -> None: ...
def readwrite(obj: Any, flags: int) -> None: ...
def poll(timeout: float = ..., map: _MapType | None = ...) -> None: ...
def poll2(timeout: float = ..., map: _MapType | None = ...) -> None: ...
def poll(timeout: float = ..., map: _MapType | None = None) -> None: ...
def poll2(timeout: float = ..., map: _MapType | None = None) -> None: ...
poll3 = poll2
def loop(timeout: float = ..., use_poll: bool = ..., map: _MapType | None = ..., count: int | None = ...) -> None: ...
def loop(timeout: float = ..., use_poll: bool = False, map: _MapType | None = None, count: int | None = None) -> None: ...
# Not really subclass of socket.socket; it's only delegation.
# It is not covariant to it.
@@ -33,11 +33,11 @@ class dispatcher:
closing: bool
ignore_log_types: frozenset[str]
socket: _Socket | None
def __init__(self, sock: _Socket | None = ..., map: _MapType | None = ...) -> None: ...
def add_channel(self, map: _MapType | None = ...) -> None: ...
def del_channel(self, map: _MapType | None = ...) -> None: ...
def create_socket(self, family: int = ..., type: int = ...) -> None: ...
def set_socket(self, sock: _Socket, map: _MapType | None = ...) -> None: ...
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 set_socket(self, sock: _Socket, map: _MapType | None = None) -> None: ...
def set_reuse_addr(self) -> None: ...
def readable(self) -> bool: ...
def writable(self) -> bool: ...
@@ -49,7 +49,7 @@ class dispatcher:
def recv(self, buffer_size: int) -> bytes: ...
def close(self) -> None: ...
def log(self, message: Any) -> None: ...
def log_info(self, message: Any, type: str = ...) -> None: ...
def log_info(self, message: Any, type: str = "info") -> None: ...
def handle_read_event(self) -> None: ...
def handle_connect_event(self) -> None: ...
def handle_write_event(self) -> None: ...
@@ -68,7 +68,7 @@ class dispatcher_with_send(dispatcher):
# def send(self, data: bytes) -> int | None: ...
def compact_traceback() -> tuple[tuple[str, str, str], type, type, str]: ...
def close_all(map: _MapType | None = ..., ignore_all: bool = ...) -> None: ...
def close_all(map: _MapType | None = None, ignore_all: bool = False) -> None: ...
if sys.platform != "win32":
class file_wrapper:
@@ -86,5 +86,5 @@ if sys.platform != "win32":
def fileno(self) -> int: ...
class file_dispatcher(dispatcher):
def __init__(self, fd: FileDescriptorLike, map: _MapType | None = ...) -> None: ...
def __init__(self, fd: FileDescriptorLike, map: _MapType | None = None) -> None: ...
def set_file(self, fd: int) -> None: ...

View File

@@ -26,26 +26,28 @@ __all__ = [
if sys.version_info >= (3, 10):
__all__ += ["b32hexencode", "b32hexdecode"]
def b64encode(s: ReadableBuffer, altchars: ReadableBuffer | None = ...) -> bytes: ...
def b64decode(s: str | ReadableBuffer, altchars: ReadableBuffer | None = ..., validate: bool = ...) -> bytes: ...
def b64encode(s: ReadableBuffer, altchars: ReadableBuffer | None = None) -> bytes: ...
def b64decode(s: str | ReadableBuffer, altchars: ReadableBuffer | None = None, validate: bool = False) -> bytes: ...
def standard_b64encode(s: ReadableBuffer) -> bytes: ...
def standard_b64decode(s: str | ReadableBuffer) -> bytes: ...
def urlsafe_b64encode(s: ReadableBuffer) -> bytes: ...
def urlsafe_b64decode(s: str | ReadableBuffer) -> bytes: ...
def b32encode(s: ReadableBuffer) -> bytes: ...
def b32decode(s: str | ReadableBuffer, casefold: bool = ..., map01: bytes | None = ...) -> bytes: ...
def b32decode(s: str | ReadableBuffer, casefold: bool = False, map01: bytes | None = None) -> bytes: ...
def b16encode(s: ReadableBuffer) -> bytes: ...
def b16decode(s: str | ReadableBuffer, casefold: bool = ...) -> bytes: ...
def b16decode(s: str | ReadableBuffer, casefold: bool = False) -> bytes: ...
if sys.version_info >= (3, 10):
def b32hexencode(s: ReadableBuffer) -> bytes: ...
def b32hexdecode(s: str | ReadableBuffer, casefold: bool = ...) -> bytes: ...
def b32hexdecode(s: str | ReadableBuffer, casefold: bool = False) -> bytes: ...
def a85encode(b: ReadableBuffer, *, foldspaces: bool = ..., wrapcol: int = ..., pad: bool = ..., adobe: bool = ...) -> bytes: ...
def a85decode(
b: str | ReadableBuffer, *, foldspaces: bool = ..., adobe: bool = ..., ignorechars: bytearray | bytes = ...
def a85encode(
b: ReadableBuffer, *, foldspaces: bool = False, wrapcol: int = 0, pad: bool = False, adobe: bool = False
) -> bytes: ...
def b85encode(b: ReadableBuffer, pad: bool = ...) -> bytes: ...
def a85decode(
b: str | ReadableBuffer, *, foldspaces: bool = False, adobe: bool = False, ignorechars: bytearray | bytes = ...
) -> bytes: ...
def b85encode(b: ReadableBuffer, pad: bool = False) -> bytes: ...
def b85decode(b: str | ReadableBuffer) -> bytes: ...
def decode(input: IO[bytes], output: IO[bytes]) -> None: ...
def encode(input: IO[bytes], output: IO[bytes]) -> None: ...

View File

@@ -24,7 +24,7 @@ class Bdb:
stopframe: FrameType | None
returnframe: FrameType | None
stoplineno: int
def __init__(self, skip: Iterable[str] | None = ...) -> None: ...
def __init__(self, skip: Iterable[str] | None = None) -> None: ...
def canonic(self, filename: str) -> str: ...
def reset(self) -> None: ...
def trace_dispatch(self, frame: FrameType, event: str, arg: Any) -> TraceFunction: ...
@@ -41,15 +41,15 @@ class Bdb:
def user_line(self, frame: FrameType) -> None: ...
def user_return(self, frame: FrameType, return_value: Any) -> None: ...
def user_exception(self, frame: FrameType, exc_info: ExcInfo) -> None: ...
def set_until(self, frame: FrameType, lineno: int | None = ...) -> None: ...
def set_until(self, frame: FrameType, lineno: int | None = None) -> None: ...
def set_step(self) -> None: ...
def set_next(self, frame: FrameType) -> None: ...
def set_return(self, frame: FrameType) -> None: ...
def set_trace(self, frame: FrameType | None = ...) -> None: ...
def set_trace(self, frame: FrameType | None = None) -> None: ...
def set_continue(self) -> None: ...
def set_quit(self) -> None: ...
def set_break(
self, filename: str, lineno: int, temporary: bool = ..., cond: str | None = ..., funcname: str | None = ...
self, filename: str, lineno: int, temporary: bool = False, cond: str | None = None, funcname: str | None = None
) -> None: ...
def clear_break(self, filename: str, lineno: int) -> None: ...
def clear_bpbynumber(self, arg: SupportsInt) -> None: ...
@@ -61,9 +61,11 @@ class Bdb:
def get_file_breaks(self, filename: str) -> list[Breakpoint]: ...
def get_all_breaks(self) -> list[Breakpoint]: ...
def get_stack(self, f: FrameType | None, t: TracebackType | None) -> tuple[list[tuple[FrameType, int]], int]: ...
def format_stack_entry(self, frame_lineno: int, lprefix: str = ...) -> str: ...
def run(self, cmd: str | CodeType, globals: dict[str, Any] | None = ..., locals: Mapping[str, Any] | None = ...) -> None: ...
def runeval(self, expr: str, globals: dict[str, Any] | None = ..., locals: Mapping[str, Any] | None = ...) -> None: ...
def format_stack_entry(self, frame_lineno: int, lprefix: str = ": ") -> str: ...
def run(
self, cmd: str | CodeType, globals: dict[str, Any] | None = None, locals: Mapping[str, Any] | None = None
) -> None: ...
def runeval(self, expr: str, globals: dict[str, Any] | None = None, locals: Mapping[str, Any] | None = None) -> None: ...
def runctx(self, cmd: str | CodeType, globals: dict[str, Any] | None, locals: Mapping[str, Any] | None) -> None: ...
def runcall(self, __func: Callable[_P, _T], *args: _P.args, **kwds: _P.kwargs) -> _T | None: ...
@@ -84,7 +86,7 @@ class Breakpoint:
hits: int
number: int
def __init__(
self, file: str, line: int, temporary: bool = ..., cond: str | None = ..., funcname: str | None = ...
self, file: str, line: int, temporary: bool = False, cond: str | None = None, funcname: str | None = None
) -> None: ...
if sys.version_info >= (3, 11):
@staticmethod
@@ -93,7 +95,7 @@ class Breakpoint:
def deleteMe(self) -> None: ...
def enable(self) -> None: ...
def disable(self) -> None: ...
def bpprint(self, out: IO[str] | None = ...) -> None: ...
def bpprint(self, out: IO[str] | None = None) -> None: ...
def bpformat(self) -> str: ...
def checkfuncname(b: Breakpoint, frame: FrameType) -> bool: ...

View File

@@ -7,17 +7,17 @@ from typing_extensions import TypeAlias
_AsciiBuffer: TypeAlias = str | ReadableBuffer
def a2b_uu(__data: _AsciiBuffer) -> bytes: ...
def b2a_uu(__data: ReadableBuffer, *, backtick: bool = ...) -> bytes: ...
def b2a_uu(__data: ReadableBuffer, *, backtick: bool = False) -> bytes: ...
if sys.version_info >= (3, 11):
def a2b_base64(__data: _AsciiBuffer, *, strict_mode: bool = ...) -> bytes: ...
def a2b_base64(__data: _AsciiBuffer, *, strict_mode: bool = False) -> bytes: ...
else:
def a2b_base64(__data: _AsciiBuffer) -> bytes: ...
def b2a_base64(__data: ReadableBuffer, *, newline: bool = ...) -> bytes: ...
def a2b_qp(data: _AsciiBuffer, header: bool = ...) -> bytes: ...
def b2a_qp(data: ReadableBuffer, quotetabs: bool = ..., istext: bool = ..., header: bool = ...) -> bytes: ...
def b2a_base64(__data: ReadableBuffer, *, newline: bool = True) -> bytes: ...
def a2b_qp(data: _AsciiBuffer, header: bool = False) -> bytes: ...
def b2a_qp(data: ReadableBuffer, quotetabs: bool = False, istext: bool = True, header: bool = False) -> bytes: ...
if sys.version_info < (3, 11):
def a2b_hqx(__data: _AsciiBuffer) -> bytes: ...

View File

@@ -217,15 +217,15 @@ class int:
if sys.version_info >= (3, 11):
def to_bytes(
self, length: SupportsIndex = ..., byteorder: Literal["little", "big"] = ..., *, signed: bool = ...
self, length: SupportsIndex = 1, byteorder: Literal["little", "big"] = "big", *, signed: bool = False
) -> bytes: ...
@classmethod
def from_bytes(
cls: type[Self],
bytes: Iterable[SupportsIndex] | SupportsBytes | ReadableBuffer,
byteorder: Literal["little", "big"] = ...,
byteorder: Literal["little", "big"] = "big",
*,
signed: bool = ...,
signed: bool = False,
) -> Self: ...
else:
def to_bytes(self, length: SupportsIndex, byteorder: Literal["little", "big"], *, signed: bool = ...) -> bytes: ...
@@ -426,7 +426,7 @@ class str(Sequence[str]):
@overload
def center(self, __width: SupportsIndex, __fillchar: str = ...) -> str: ... # type: ignore[misc]
def count(self, x: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ...
def encode(self, encoding: str = ..., errors: str = ...) -> bytes: ...
def encode(self, encoding: str = "utf-8", errors: str = "strict") -> bytes: ...
def endswith(
self, __suffix: str | tuple[str, ...], __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
) -> bool: ...
@@ -596,7 +596,7 @@ class bytes(ByteString):
def count(
self, __sub: ReadableBuffer | SupportsIndex, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
) -> int: ...
def decode(self, encoding: str = ..., errors: str = ...) -> str: ...
def decode(self, encoding: str = "utf-8", errors: str = "strict") -> str: ...
def endswith(
self,
__suffix: ReadableBuffer | tuple[ReadableBuffer, ...],
@@ -604,7 +604,7 @@ class bytes(ByteString):
__end: SupportsIndex | None = ...,
) -> bool: ...
if sys.version_info >= (3, 8):
def expandtabs(self, tabsize: SupportsIndex = ...) -> bytes: ...
def expandtabs(self, tabsize: SupportsIndex = 8) -> bytes: ...
else:
def expandtabs(self, tabsize: int = ...) -> bytes: ...
@@ -645,10 +645,10 @@ class bytes(ByteString):
) -> int: ...
def rjust(self, __width: SupportsIndex, __fillchar: bytes | bytearray = ...) -> bytes: ...
def rpartition(self, __sep: ReadableBuffer) -> tuple[bytes, bytes, bytes]: ...
def rsplit(self, sep: ReadableBuffer | None = ..., maxsplit: SupportsIndex = ...) -> list[bytes]: ...
def rsplit(self, sep: ReadableBuffer | None = None, maxsplit: SupportsIndex = -1) -> list[bytes]: ...
def rstrip(self, __bytes: ReadableBuffer | None = ...) -> bytes: ...
def split(self, sep: ReadableBuffer | None = ..., maxsplit: SupportsIndex = ...) -> list[bytes]: ...
def splitlines(self, keepends: bool = ...) -> list[bytes]: ...
def split(self, sep: ReadableBuffer | None = None, maxsplit: SupportsIndex = -1) -> list[bytes]: ...
def splitlines(self, keepends: bool = False) -> list[bytes]: ...
def startswith(
self,
__prefix: ReadableBuffer | tuple[ReadableBuffer, ...],
@@ -701,7 +701,7 @@ class bytearray(MutableSequence[int], ByteString):
self, __sub: ReadableBuffer | SupportsIndex, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
) -> int: ...
def copy(self) -> bytearray: ...
def decode(self, encoding: str = ..., errors: str = ...) -> str: ...
def decode(self, encoding: str = "utf-8", errors: str = "strict") -> str: ...
def endswith(
self,
__suffix: ReadableBuffer | tuple[ReadableBuffer, ...],
@@ -709,7 +709,7 @@ class bytearray(MutableSequence[int], ByteString):
__end: SupportsIndex | None = ...,
) -> bool: ...
if sys.version_info >= (3, 8):
def expandtabs(self, tabsize: SupportsIndex = ...) -> bytearray: ...
def expandtabs(self, tabsize: SupportsIndex = 8) -> bytearray: ...
else:
def expandtabs(self, tabsize: int = ...) -> bytearray: ...
@@ -754,10 +754,10 @@ class bytearray(MutableSequence[int], ByteString):
) -> int: ...
def rjust(self, __width: SupportsIndex, __fillchar: bytes | bytearray = ...) -> bytearray: ...
def rpartition(self, __sep: ReadableBuffer) -> tuple[bytearray, bytearray, bytearray]: ...
def rsplit(self, sep: ReadableBuffer | None = ..., maxsplit: SupportsIndex = ...) -> list[bytearray]: ...
def rsplit(self, sep: ReadableBuffer | None = None, maxsplit: SupportsIndex = -1) -> list[bytearray]: ...
def rstrip(self, __bytes: ReadableBuffer | None = ...) -> bytearray: ...
def split(self, sep: ReadableBuffer | None = ..., maxsplit: SupportsIndex = ...) -> list[bytearray]: ...
def splitlines(self, keepends: bool = ...) -> list[bytearray]: ...
def split(self, sep: ReadableBuffer | None = None, maxsplit: SupportsIndex = -1) -> list[bytearray]: ...
def splitlines(self, keepends: bool = False) -> list[bytearray]: ...
def startswith(
self,
__prefix: ReadableBuffer | tuple[ReadableBuffer, ...],
@@ -847,7 +847,7 @@ class memoryview(Sequence[int]):
@overload
def __setitem__(self, __i: SupportsIndex, __o: SupportsIndex) -> None: ...
if sys.version_info >= (3, 8):
def tobytes(self, order: Literal["C", "F", "A"] | None = ...) -> bytes: ...
def tobytes(self, order: Literal["C", "F", "A"] | None = "C") -> bytes: ...
else:
def tobytes(self) -> bytes: ...
@@ -1226,11 +1226,11 @@ if sys.version_info >= (3, 8):
source: str | ReadableBuffer | _ast.Module | _ast.Expression | _ast.Interactive,
filename: str | ReadableBuffer | _PathLike[Any],
mode: str,
flags: int = ...,
dont_inherit: int = ...,
optimize: int = ...,
flags: int = 0,
dont_inherit: int = False,
optimize: int = -1,
*,
_feature_version: int = ...,
_feature_version: int = -1,
) -> Any: ...
else:
@@ -1265,7 +1265,7 @@ if sys.version_info >= (3, 11):
__globals: dict[str, Any] | None = ...,
__locals: Mapping[str, object] | None = ...,
*,
closure: tuple[_Cell, ...] | None = ...,
closure: tuple[_Cell, ...] | None = None,
) -> None: ...
else:
@@ -1275,7 +1275,7 @@ else:
__locals: Mapping[str, object] | None = ...,
) -> None: ...
def exit(code: sys._ExitCode = ...) -> NoReturn: ...
def exit(code: sys._ExitCode = None) -> NoReturn: ...
class filter(Iterator[_T], Generic[_T]):
@overload
@@ -1605,7 +1605,7 @@ else:
@overload
def pow(__base: _SupportsSomeKindOfPow, __exp: complex, __mod: None = ...) -> complex: ...
def quit(code: sys._ExitCode = ...) -> NoReturn: ...
def quit(code: sys._ExitCode = None) -> NoReturn: ...
class reversed(Iterator[_T], Generic[_T]):
@overload
@@ -1763,10 +1763,10 @@ class zip(Iterator[_T_co], Generic[_T_co]):
# Return type of `__import__` should be kept the same as return type of `importlib.import_module`
def __import__(
name: str,
globals: Mapping[str, object] | None = ...,
locals: Mapping[str, object] | None = ...,
globals: Mapping[str, object] | None = None,
locals: Mapping[str, object] | None = None,
fromlist: Sequence[str] = ...,
level: int = ...,
level: int = 0,
) -> types.ModuleType: ...
def __build_class__(__func: Callable[[], _Cell | Any], __name: str, *bases: Any, metaclass: Any = ..., **kwds: Any) -> Any: ...

View File

@@ -19,7 +19,7 @@ class _WritableFileobj(Protocol):
# def fileno(self) -> int: ...
# def close(self) -> object: ...
def compress(data: ReadableBuffer, compresslevel: int = ...) -> bytes: ...
def compress(data: ReadableBuffer, compresslevel: int = 9) -> bytes: ...
def decompress(data: ReadableBuffer) -> bytes: ...
_ReadBinaryMode: TypeAlias = Literal["", "r", "rb"]
@@ -120,12 +120,12 @@ class BZ2File(BaseStream, IO[bytes]):
compresslevel: int = ...,
) -> None: ...
def read(self, size: int | None = ...) -> bytes: ...
def read1(self, size: int = ...) -> bytes: ...
def readline(self, size: SupportsIndex = ...) -> bytes: ... # type: ignore[override]
def read(self, size: int | None = -1) -> bytes: ...
def read1(self, size: int = -1) -> bytes: ...
def readline(self, size: SupportsIndex = -1) -> bytes: ... # type: ignore[override]
def readinto(self, b: WriteableBuffer) -> int: ...
def readlines(self, size: SupportsIndex = ...) -> list[bytes]: ...
def seek(self, offset: int, whence: int = ...) -> int: ...
def readlines(self, size: SupportsIndex = -1) -> list[bytes]: ...
def seek(self, offset: int, whence: int = 0) -> int: ...
def write(self, data: ReadableBuffer) -> int: ...
def writelines(self, seq: Iterable[ReadableBuffer]) -> None: ...
@@ -137,7 +137,7 @@ class BZ2Compressor:
@final
class BZ2Decompressor:
def decompress(self, data: ReadableBuffer, max_length: int = ...) -> bytes: ...
def decompress(self, data: ReadableBuffer, max_length: int = -1) -> bytes: ...
@property
def eof(self) -> bool: ...
@property

View File

@@ -7,9 +7,9 @@ from typing_extensions import ParamSpec, TypeAlias
__all__ = ["run", "runctx", "Profile"]
def run(statement: str, filename: str | None = ..., sort: str | int = ...) -> None: ...
def run(statement: str, filename: str | None = None, sort: str | int = -1) -> None: ...
def runctx(
statement: str, globals: dict[str, Any], locals: dict[str, Any], filename: str | None = ..., sort: str | int = ...
statement: str, globals: dict[str, Any], locals: dict[str, Any], filename: str | None = None, sort: str | int = -1
) -> None: ...
_T = TypeVar("_T")
@@ -23,7 +23,7 @@ class Profile:
) -> None: ...
def enable(self) -> None: ...
def disable(self) -> None: ...
def print_stats(self, sort: str | int = ...) -> None: ...
def print_stats(self, sort: str | int = -1) -> None: ...
def dump_stats(self, file: StrOrBytesPath) -> None: ...
def create_stats(self) -> None: ...
def snapshot_stats(self) -> None: ...

View File

@@ -51,7 +51,7 @@ def monthrange(year: int, month: int) -> tuple[int, int]: ...
class Calendar:
firstweekday: int
def __init__(self, firstweekday: int = ...) -> None: ...
def __init__(self, firstweekday: int = 0) -> None: ...
def getfirstweekday(self) -> int: ...
def setfirstweekday(self, firstweekday: int) -> None: ...
def iterweekdays(self) -> Iterable[int]: ...
@@ -61,9 +61,9 @@ class Calendar:
def monthdatescalendar(self, year: int, month: int) -> list[list[datetime.date]]: ...
def monthdays2calendar(self, year: int, month: int) -> list[list[tuple[int, int]]]: ...
def monthdayscalendar(self, year: int, month: int) -> list[list[int]]: ...
def yeardatescalendar(self, year: int, width: int = ...) -> list[list[int]]: ...
def yeardays2calendar(self, year: int, width: int = ...) -> list[list[tuple[int, int]]]: ...
def yeardayscalendar(self, year: int, width: int = ...) -> list[list[int]]: ...
def yeardatescalendar(self, year: int, width: int = 3) -> list[list[int]]: ...
def yeardays2calendar(self, year: int, width: int = 3) -> list[list[tuple[int, int]]]: ...
def yeardayscalendar(self, year: int, width: int = 3) -> list[list[int]]: ...
def itermonthdays3(self, year: int, month: int) -> Iterable[tuple[int, int, int]]: ...
def itermonthdays4(self, year: int, month: int) -> Iterable[tuple[int, int, int, int]]: ...
@@ -73,21 +73,21 @@ class TextCalendar(Calendar):
def formatweek(self, theweek: int, width: int) -> str: ...
def formatweekday(self, day: int, width: int) -> str: ...
def formatweekheader(self, width: int) -> str: ...
def formatmonthname(self, theyear: int, themonth: int, width: int, withyear: bool = ...) -> str: ...
def prmonth(self, theyear: int, themonth: int, w: int = ..., l: int = ...) -> None: ...
def formatmonth(self, theyear: int, themonth: int, w: int = ..., l: int = ...) -> str: ...
def formatyear(self, theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> str: ...
def pryear(self, theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> None: ...
def formatmonthname(self, theyear: int, themonth: int, width: int, withyear: bool = True) -> str: ...
def prmonth(self, theyear: int, themonth: int, w: int = 0, l: int = 0) -> None: ...
def formatmonth(self, theyear: int, themonth: int, w: int = 0, l: int = 0) -> str: ...
def formatyear(self, theyear: int, w: int = 2, l: int = 1, c: int = 6, m: int = 3) -> str: ...
def pryear(self, theyear: int, w: int = 0, l: int = 0, c: int = 6, m: int = 3) -> None: ...
def firstweekday() -> int: ...
def monthcalendar(year: int, month: int) -> list[list[int]]: ...
def prweek(theweek: int, width: int) -> None: ...
def week(theweek: int, width: int) -> str: ...
def weekheader(width: int) -> str: ...
def prmonth(theyear: int, themonth: int, w: int = ..., l: int = ...) -> None: ...
def month(theyear: int, themonth: int, w: int = ..., l: int = ...) -> str: ...
def calendar(theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> str: ...
def prcal(theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> None: ...
def prmonth(theyear: int, themonth: int, w: int = 0, l: int = 0) -> None: ...
def month(theyear: int, themonth: int, w: int = 0, l: int = 0) -> str: ...
def calendar(theyear: int, w: int = 2, l: int = 1, c: int = 6, m: int = 3) -> str: ...
def prcal(theyear: int, w: int = 0, l: int = 0, c: int = 6, m: int = 3) -> None: ...
class HTMLCalendar(Calendar):
cssclasses: ClassVar[list[str]]
@@ -101,10 +101,12 @@ class HTMLCalendar(Calendar):
def formatweek(self, theweek: int) -> str: ...
def formatweekday(self, day: int) -> str: ...
def formatweekheader(self) -> str: ...
def formatmonthname(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ...
def formatmonth(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ...
def formatyear(self, theyear: int, width: int = ...) -> str: ...
def formatyearpage(self, theyear: int, width: int = ..., css: str | None = ..., encoding: str | None = ...) -> str: ...
def formatmonthname(self, theyear: int, themonth: int, withyear: bool = True) -> str: ...
def formatmonth(self, theyear: int, themonth: int, withyear: bool = True) -> str: ...
def formatyear(self, theyear: int, width: int = 3) -> str: ...
def formatyearpage(
self, theyear: int, width: int = 3, css: str | None = "calendar.css", encoding: str | None = None
) -> str: ...
class different_locale:
def __init__(self, locale: _LocaleType) -> None: ...
@@ -112,18 +114,18 @@ class different_locale:
def __exit__(self, *args: Unused) -> None: ...
class LocaleTextCalendar(TextCalendar):
def __init__(self, firstweekday: int = ..., locale: _LocaleType | None = ...) -> None: ...
def __init__(self, firstweekday: int = 0, locale: _LocaleType | None = None) -> None: ...
class LocaleHTMLCalendar(HTMLCalendar):
def __init__(self, firstweekday: int = ..., locale: _LocaleType | None = ...) -> None: ...
def __init__(self, firstweekday: int = 0, locale: _LocaleType | None = None) -> None: ...
def formatweekday(self, day: int) -> str: ...
def formatmonthname(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ...
def formatmonthname(self, theyear: int, themonth: int, withyear: bool = True) -> str: ...
c: TextCalendar
def setfirstweekday(firstweekday: int) -> None: ...
def format(cols: int, colwidth: int = ..., spacing: int = ...) -> str: ...
def formatstring(cols: int, colwidth: int = ..., spacing: int = ...) -> str: ...
def format(cols: int, colwidth: int = 20, spacing: int = 6) -> str: ...
def formatstring(cols: int, colwidth: int = 20, spacing: int = 6) -> str: ...
def timegm(tuple: tuple[int, ...] | struct_time) -> int: ...
# Data attributes

View File

@@ -25,11 +25,11 @@ if sys.version_info < (3, 8):
__all__ += ["parse_qs", "parse_qsl", "escape"]
def parse(
fp: IO[Any] | None = ...,
fp: IO[Any] | None = None,
environ: SupportsItemAccess[str, str] = ...,
keep_blank_values: bool = ...,
strict_parsing: bool = ...,
separator: str = ...,
separator: str = "&",
) -> dict[str, list[str]]: ...
if sys.version_info < (3, 8):
@@ -37,7 +37,7 @@ if sys.version_info < (3, 8):
def parse_qsl(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> list[tuple[str, str]]: ...
def parse_multipart(
fp: IO[Any], pdict: SupportsGetItem[str, bytes], encoding: str = ..., errors: str = ..., separator: str = ...
fp: IO[Any], pdict: SupportsGetItem[str, bytes], encoding: str = "utf-8", errors: str = "replace", separator: str = "&"
) -> dict[str, list[Any]]: ...
class _Environ(Protocol):
@@ -93,24 +93,24 @@ class FieldStorage:
value: None | bytes | _list[Any]
def __init__(
self,
fp: IO[Any] | None = ...,
headers: Mapping[str, str] | Message | None = ...,
fp: IO[Any] | None = None,
headers: Mapping[str, str] | Message | None = None,
outerboundary: bytes = ...,
environ: SupportsGetItem[str, str] = ...,
keep_blank_values: int = ...,
strict_parsing: int = ...,
limit: int | None = ...,
encoding: str = ...,
errors: str = ...,
max_num_fields: int | None = ...,
separator: str = ...,
keep_blank_values: int = 0,
strict_parsing: int = 0,
limit: int | None = None,
encoding: str = "utf-8",
errors: str = "replace",
max_num_fields: int | None = None,
separator: str = "&",
) -> None: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, *args: Unused) -> None: ...
def __iter__(self) -> Iterator[str]: ...
def __getitem__(self, key: str) -> Any: ...
def getvalue(self, key: str, default: Any = ...) -> Any: ...
def getfirst(self, key: str, default: Any = ...) -> Any: ...
def getvalue(self, key: str, default: Any = None) -> Any: ...
def getfirst(self, key: str, default: Any = None) -> Any: ...
def getlist(self, key: str) -> _list[Any]: ...
def keys(self) -> _list[str]: ...
def __contains__(self, key: str) -> bool: ...
@@ -120,9 +120,9 @@ class FieldStorage:
def make_file(self) -> IO[Any]: ...
def print_exception(
type: type[BaseException] | None = ...,
value: BaseException | None = ...,
tb: TracebackType | None = ...,
limit: int | None = ...,
type: type[BaseException] | None = None,
value: BaseException | None = None,
tb: TracebackType | None = None,
limit: int | None = None,
) -> None: ...
def print_arguments() -> None: ...

View File

@@ -13,20 +13,20 @@ def lookup(name: str, frame: FrameType, locals: dict[str, Any]) -> tuple[str | N
def scanvars(
reader: Callable[[], bytes], frame: FrameType, locals: dict[str, Any]
) -> list[tuple[str, str | None, Any]]: ... # undocumented
def html(einfo: OptExcInfo, context: int = ...) -> str: ...
def text(einfo: OptExcInfo, context: int = ...) -> str: ...
def html(einfo: OptExcInfo, context: int = 5) -> str: ...
def text(einfo: OptExcInfo, context: int = 5) -> str: ...
class Hook: # undocumented
def __init__(
self,
display: int = ...,
logdir: StrOrBytesPath | None = ...,
context: int = ...,
file: IO[str] | None = ...,
format: str = ...,
display: int = 1,
logdir: StrOrBytesPath | None = None,
context: int = 5,
file: IO[str] | None = None,
format: str = "html",
) -> None: ...
def __call__(self, etype: type[BaseException] | None, evalue: BaseException | None, etb: TracebackType | None) -> None: ...
def handle(self, info: OptExcInfo | None = ...) -> None: ...
def handle(self, info: OptExcInfo | None = None) -> None: ...
def handler(info: OptExcInfo | None = ...) -> None: ...
def enable(display: int = ..., logdir: StrOrBytesPath | None = ..., context: int = ..., format: str = ...) -> None: ...
def handler(info: OptExcInfo | None = None) -> None: ...
def enable(display: int = 1, logdir: StrOrBytesPath | None = None, context: int = 5, format: str = "html") -> None: ...

View File

@@ -9,12 +9,12 @@ class Chunk:
size_read: int
offset: int
seekable: bool
def __init__(self, file: IO[bytes], align: bool = ..., bigendian: bool = ..., inclheader: bool = ...) -> None: ...
def __init__(self, file: IO[bytes], align: bool = True, bigendian: bool = True, inclheader: bool = False) -> None: ...
def getname(self) -> bytes: ...
def getsize(self) -> int: ...
def close(self) -> None: ...
def isatty(self) -> bool: ...
def seek(self, pos: int, whence: int = ...) -> None: ...
def seek(self, pos: int, whence: int = 0) -> None: ...
def tell(self) -> int: ...
def read(self, size: int = ...) -> bytes: ...
def read(self, size: int = -1) -> bytes: ...
def skip(self) -> None: ...

View File

@@ -23,9 +23,9 @@ class Cmd:
stdout: IO[str]
cmdqueue: list[str]
completekey: str
def __init__(self, completekey: str = ..., stdin: IO[str] | None = ..., stdout: IO[str] | None = ...) -> None: ...
def __init__(self, completekey: str = "tab", stdin: IO[str] | None = None, stdout: IO[str] | None = None) -> None: ...
old_completer: Callable[[str, int], str | None] | None
def cmdloop(self, intro: Any | None = ...) -> None: ...
def cmdloop(self, intro: Any | None = None) -> None: ...
def precmd(self, line: str) -> str: ...
def postcmd(self, stop: bool, line: str) -> bool: ...
def preloop(self) -> None: ...
@@ -43,4 +43,4 @@ class Cmd:
def complete_help(self, *args: Any) -> list[str]: ...
def do_help(self, arg: str) -> bool | None: ...
def print_topics(self, header: str, cmds: list[str] | None, cmdlen: Any, maxcol: int) -> None: ...
def columnize(self, list: list[str] | None, displaywidth: int = ...) -> None: ...
def columnize(self, list: list[str] | None, displaywidth: int = 80) -> None: ...

View File

@@ -8,26 +8,26 @@ __all__ = ["InteractiveInterpreter", "InteractiveConsole", "interact", "compile_
class InteractiveInterpreter:
locals: Mapping[str, Any] # undocumented
compile: CommandCompiler # undocumented
def __init__(self, locals: Mapping[str, Any] | None = ...) -> None: ...
def runsource(self, source: str, filename: str = ..., symbol: str = ...) -> bool: ...
def __init__(self, locals: Mapping[str, Any] | None = None) -> None: ...
def runsource(self, source: str, filename: str = "<input>", symbol: str = "single") -> bool: ...
def runcode(self, code: CodeType) -> None: ...
def showsyntaxerror(self, filename: str | None = ...) -> None: ...
def showsyntaxerror(self, filename: str | None = None) -> None: ...
def showtraceback(self) -> None: ...
def write(self, data: str) -> None: ...
class InteractiveConsole(InteractiveInterpreter):
buffer: list[str] # undocumented
filename: str # undocumented
def __init__(self, locals: Mapping[str, Any] | None = ..., filename: str = ...) -> None: ...
def interact(self, banner: str | None = ..., exitmsg: str | None = ...) -> None: ...
def __init__(self, locals: Mapping[str, Any] | None = None, filename: str = "<console>") -> None: ...
def interact(self, banner: str | None = None, exitmsg: str | None = None) -> None: ...
def push(self, line: str) -> bool: ...
def resetbuffer(self) -> None: ...
def raw_input(self, prompt: str = ...) -> str: ...
def raw_input(self, prompt: str = "") -> str: ...
def interact(
banner: str | None = ...,
readfunc: Callable[[str], str] | None = ...,
local: Mapping[str, Any] | None = ...,
exitmsg: str | None = ...,
banner: str | None = None,
readfunc: Callable[[str], str] | None = None,
local: Mapping[str, Any] | None = None,
exitmsg: str | None = None,
) -> None: ...
def compile_command(source: str, filename: str = ..., symbol: str = ...) -> CodeType | None: ...
def compile_command(source: str, filename: str = "<input>", symbol: str = "single") -> CodeType | None: ...

View File

@@ -112,13 +112,13 @@ class CodecInfo(tuple[_Encoder, _Decoder, _StreamReader, _StreamWriter]):
cls: type[Self],
encode: _Encoder,
decode: _Decoder,
streamreader: _StreamReader | None = ...,
streamwriter: _StreamWriter | None = ...,
incrementalencoder: _IncrementalEncoder | None = ...,
incrementaldecoder: _IncrementalDecoder | None = ...,
name: str | None = ...,
streamreader: _StreamReader | None = None,
streamwriter: _StreamWriter | None = None,
incrementalencoder: _IncrementalEncoder | None = None,
incrementaldecoder: _IncrementalDecoder | None = None,
name: str | None = None,
*,
_is_text_encoding: bool | None = ...,
_is_text_encoding: bool | None = None,
) -> Self: ...
def getencoder(encoding: str) -> _Encoder: ...
@@ -128,11 +128,11 @@ def getincrementaldecoder(encoding: str) -> _IncrementalDecoder: ...
def getreader(encoding: str) -> _StreamReader: ...
def getwriter(encoding: str) -> _StreamWriter: ...
def open(
filename: str, mode: str = ..., encoding: str | None = ..., errors: str = ..., buffering: int = ...
filename: str, mode: str = "r", encoding: str | None = None, errors: str = "strict", buffering: int = -1
) -> StreamReaderWriter: ...
def EncodedFile(file: _Stream, data_encoding: str, file_encoding: str | None = ..., errors: str = ...) -> StreamRecoder: ...
def iterencode(iterator: Iterable[str], encoding: str, errors: str = ...) -> Generator[bytes, None, None]: ...
def iterdecode(iterator: Iterable[bytes], encoding: str, errors: str = ...) -> Generator[str, None, None]: ...
def EncodedFile(file: _Stream, data_encoding: str, file_encoding: str | None = None, errors: str = "strict") -> StreamRecoder: ...
def iterencode(iterator: Iterable[str], encoding: str, errors: str = "strict") -> Generator[bytes, None, None]: ...
def iterdecode(iterator: Iterable[bytes], encoding: str, errors: str = "strict") -> Generator[str, None, None]: ...
BOM: Literal[b"\xff\xfe", b"\xfe\xff"] # depends on `sys.byteorder`
BOM_BE: Literal[b"\xfe\xff"]
@@ -155,14 +155,14 @@ def namereplace_errors(exception: UnicodeError) -> tuple[str | bytes, int]: ...
class Codec:
# These are sort of @abstractmethod but sort of not.
# The StreamReader and StreamWriter subclasses only implement one.
def encode(self, input: str, errors: str = ...) -> tuple[bytes, int]: ...
def decode(self, input: bytes, errors: str = ...) -> tuple[str, int]: ...
def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ...
def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ...
class IncrementalEncoder:
errors: str
def __init__(self, errors: str = ...) -> None: ...
def __init__(self, errors: str = "strict") -> None: ...
@abstractmethod
def encode(self, input: str, final: bool = ...) -> bytes: ...
def encode(self, input: str, final: bool = False) -> bytes: ...
def reset(self) -> None: ...
# documentation says int but str is needed for the subclass.
def getstate(self) -> int | str: ...
@@ -170,9 +170,9 @@ class IncrementalEncoder:
class IncrementalDecoder:
errors: str
def __init__(self, errors: str = ...) -> None: ...
def __init__(self, errors: str = "strict") -> None: ...
@abstractmethod
def decode(self, input: ReadableBuffer, final: bool = ...) -> str: ...
def decode(self, input: ReadableBuffer, final: bool = False) -> str: ...
def reset(self) -> None: ...
def getstate(self) -> tuple[bytes, int]: ...
def setstate(self, state: tuple[bytes, int]) -> None: ...
@@ -180,24 +180,24 @@ class IncrementalDecoder:
# These are not documented but used in encodings/*.py implementations.
class BufferedIncrementalEncoder(IncrementalEncoder):
buffer: str
def __init__(self, errors: str = ...) -> None: ...
def __init__(self, errors: str = "strict") -> None: ...
@abstractmethod
def _buffer_encode(self, input: str, errors: str, final: bool) -> bytes: ...
def encode(self, input: str, final: bool = ...) -> bytes: ...
def encode(self, input: str, final: bool = False) -> bytes: ...
class BufferedIncrementalDecoder(IncrementalDecoder):
buffer: bytes
def __init__(self, errors: str = ...) -> None: ...
def __init__(self, errors: str = "strict") -> None: ...
@abstractmethod
def _buffer_decode(self, input: ReadableBuffer, errors: str, final: bool) -> tuple[str, int]: ...
def decode(self, input: ReadableBuffer, final: bool = ...) -> str: ...
def decode(self, input: ReadableBuffer, final: bool = False) -> str: ...
# TODO: it is not possible to specify the requirement that all other
# attributes and methods are passed-through from the stream.
class StreamWriter(Codec):
stream: _WritableStream
errors: str
def __init__(self, stream: _WritableStream, errors: str = ...) -> None: ...
def __init__(self, stream: _WritableStream, errors: str = "strict") -> None: ...
def write(self, object: str) -> None: ...
def writelines(self, list: Iterable[str]) -> None: ...
def reset(self) -> None: ...
@@ -208,10 +208,10 @@ class StreamWriter(Codec):
class StreamReader(Codec):
stream: _ReadableStream
errors: str
def __init__(self, stream: _ReadableStream, errors: str = ...) -> None: ...
def read(self, size: int = ..., chars: int = ..., firstline: bool = ...) -> str: ...
def readline(self, size: int | None = ..., keepends: bool = ...) -> str: ...
def readlines(self, sizehint: int | None = ..., keepends: bool = ...) -> list[str]: ...
def __init__(self, stream: _ReadableStream, errors: str = "strict") -> None: ...
def read(self, size: int = -1, chars: int = -1, firstline: bool = False) -> str: ...
def readline(self, size: int | None = None, keepends: bool = True) -> str: ...
def readlines(self, sizehint: int | None = None, keepends: bool = True) -> list[str]: ...
def reset(self) -> None: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, type: type[BaseException] | None, value: BaseException | None, tb: types.TracebackType | None) -> None: ...
@@ -223,16 +223,16 @@ class StreamReader(Codec):
# and delegates attributes to the underlying binary stream with __getattr__.
class StreamReaderWriter(TextIO):
stream: _Stream
def __init__(self, stream: _Stream, Reader: _StreamReader, Writer: _StreamWriter, errors: str = ...) -> None: ...
def read(self, size: int = ...) -> str: ...
def readline(self, size: int | None = ...) -> str: ...
def readlines(self, sizehint: int | None = ...) -> list[str]: ...
def __init__(self, stream: _Stream, Reader: _StreamReader, Writer: _StreamWriter, errors: str = "strict") -> None: ...
def read(self, size: int = -1) -> str: ...
def readline(self, size: int | None = None) -> str: ...
def readlines(self, sizehint: int | None = None) -> list[str]: ...
def __next__(self) -> str: ...
def __iter__(self: Self) -> Self: ...
def write(self, data: str) -> None: ... # type: ignore[override]
def writelines(self, list: Iterable[str]) -> None: ...
def reset(self) -> None: ...
def seek(self, offset: int, whence: int = ...) -> None: ... # type: ignore[override]
def seek(self, offset: int, whence: int = 0) -> None: ... # type: ignore[override]
def __enter__(self: Self) -> Self: ...
def __exit__(self, type: type[BaseException] | None, value: BaseException | None, tb: types.TracebackType | None) -> None: ...
def __getattr__(self, name: str) -> Any: ...
@@ -250,11 +250,17 @@ class StreamReaderWriter(TextIO):
class StreamRecoder(BinaryIO):
def __init__(
self, stream: _Stream, encode: _Encoder, decode: _Decoder, Reader: _StreamReader, Writer: _StreamWriter, errors: str = ...
self,
stream: _Stream,
encode: _Encoder,
decode: _Decoder,
Reader: _StreamReader,
Writer: _StreamWriter,
errors: str = "strict",
) -> None: ...
def read(self, size: int = ...) -> bytes: ...
def readline(self, size: int | None = ...) -> bytes: ...
def readlines(self, sizehint: int | None = ...) -> list[bytes]: ...
def read(self, size: int = -1) -> bytes: ...
def readline(self, size: int | None = None) -> bytes: ...
def readlines(self, sizehint: int | None = None) -> list[bytes]: ...
def __next__(self) -> bytes: ...
def __iter__(self: Self) -> Self: ...
def write(self, data: bytes) -> None: ... # type: ignore[override]
@@ -263,7 +269,7 @@ class StreamRecoder(BinaryIO):
def __getattr__(self, name: str) -> Any: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, type: type[BaseException] | None, value: BaseException | None, tb: types.TracebackType | None) -> None: ...
def seek(self, offset: int, whence: int = ...) -> None: ... # type: ignore[override]
def seek(self, offset: int, whence: int = 0) -> None: ... # type: ignore[override]
# These methods don't actually exist directly, but they are needed to satisfy the BinaryIO
# interface. At runtime, they are delegated through __getattr__.
def close(self) -> None: ...

View File

@@ -2,7 +2,7 @@ from types import CodeType
__all__ = ["compile_command", "Compile", "CommandCompiler"]
def compile_command(source: str, filename: str = ..., symbol: str = ...) -> CodeType | None: ...
def compile_command(source: str, filename: str = "<input>", symbol: str = "single") -> CodeType | None: ...
class Compile:
flags: int
@@ -10,4 +10,4 @@ class Compile:
class CommandCompiler:
compiler: Compile
def __call__(self, source: str, filename: str = ..., symbol: str = ...) -> CodeType | None: ...
def __call__(self, source: str, filename: str = "<input>", symbol: str = "single") -> CodeType | None: ...

View File

@@ -40,9 +40,9 @@ def namedtuple(
typename: str,
field_names: str | Iterable[str],
*,
rename: bool = ...,
module: str | None = ...,
defaults: Iterable[Any] | None = ...,
rename: bool = False,
module: str | None = None,
defaults: Iterable[Any] | None = None,
) -> type[tuple[Any, ...]]: ...
class UserDict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
@@ -119,7 +119,7 @@ class UserList(MutableSequence[_T]):
def __imul__(self: Self, n: int) -> Self: ...
def append(self, item: _T) -> None: ...
def insert(self, i: int, item: _T) -> None: ...
def pop(self, i: int = ...) -> _T: ...
def pop(self, i: int = -1) -> _T: ...
def remove(self, item: _T) -> None: ...
def copy(self: Self) -> Self: ...
def __copy__(self: Self) -> Self: ...
@@ -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 = ..., end: int = ...) -> int: ...
def count(self, sub: str | UserString, start: int = 0, end: int = 9223372036854775807) -> int: ...
if sys.version_info >= (3, 8):
def encode(self: UserString, encoding: str | None = ..., errors: str | None = ...) -> bytes: ...
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 = ..., end: int | None = ...) -> bool: ...
def expandtabs(self: Self, tabsize: int = ...) -> Self: ...
def find(self, sub: str | UserString, start: int = ..., end: int = ...) -> int: ...
def endswith(self, suffix: str | tuple[str, ...], start: int | None = 0, end: int | None = 9223372036854775807) -> bool: ...
def expandtabs(self: Self, tabsize: int = 8) -> Self: ...
def find(self, sub: str | UserString, start: int = 0, end: int = 9223372036854775807) -> 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 = ..., end: int = ...) -> int: ...
def index(self, sub: str, start: int = 0, end: int = 9223372036854775807) -> int: ...
def isalpha(self) -> bool: ...
def isalnum(self) -> bool: ...
def isdecimal(self) -> bool: ...
@@ -190,7 +190,7 @@ class UserString(Sequence[UserString]):
def join(self, seq: Iterable[str]) -> str: ...
def ljust(self: Self, width: int, *args: Any) -> Self: ...
def lower(self: Self) -> Self: ...
def lstrip(self: Self, chars: str | None = ...) -> Self: ...
def lstrip(self: Self, chars: str | None = None) -> Self: ...
@staticmethod
@overload
def maketrans(x: dict[int, _T] | dict[str, _T] | dict[str | int, _T]) -> dict[int, _T]: ...
@@ -202,17 +202,17 @@ class UserString(Sequence[UserString]):
def removeprefix(self: Self, __prefix: str | UserString) -> Self: ...
def removesuffix(self: Self, __suffix: str | UserString) -> Self: ...
def replace(self: Self, old: str | UserString, new: str | UserString, maxsplit: int = ...) -> Self: ...
def rfind(self, sub: str | UserString, start: int = ..., end: int = ...) -> int: ...
def rindex(self, sub: str | UserString, start: int = ..., end: int = ...) -> int: ...
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 rjust(self: Self, width: int, *args: Any) -> Self: ...
def rpartition(self, sep: str) -> tuple[str, str, str]: ...
def rstrip(self: Self, chars: str | None = ...) -> Self: ...
def split(self, sep: str | None = ..., maxsplit: int = ...) -> list[str]: ...
def rsplit(self, sep: str | None = ..., maxsplit: int = ...) -> list[str]: ...
def splitlines(self, keepends: bool = ...) -> list[str]: ...
def startswith(self, prefix: str | tuple[str, ...], start: int | None = ..., end: int | None = ...) -> bool: ...
def strip(self: Self, chars: str | None = ...) -> Self: ...
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 strip(self: Self, chars: str | None = None) -> Self: ...
def swapcase(self: Self) -> Self: ...
def title(self: Self) -> Self: ...
def translate(self: Self, *args: Any) -> Self: ...
@@ -268,9 +268,9 @@ class Counter(dict[_T, int], Generic[_T]):
def __init__(self, __iterable: Iterable[_T]) -> None: ...
def copy(self: Self) -> Self: ...
def elements(self) -> Iterator[_T]: ...
def most_common(self, n: int | None = ...) -> list[tuple[_T, int]]: ...
def most_common(self, n: int | None = None) -> list[tuple[_T, int]]: ...
@classmethod
def fromkeys(cls, iterable: Any, v: int | None = ...) -> NoReturn: ... # type: ignore[override]
def fromkeys(cls, iterable: Any, v: int | None = None) -> NoReturn: ... # type: ignore[override]
@overload
def subtract(self, __iterable: None = ...) -> None: ...
@overload
@@ -341,8 +341,8 @@ class _odict_values(dict_values[_KT_co, _VT_co], Reversible[_VT_co], Generic[_KT
def __reversed__(self) -> Iterator[_VT_co]: ...
class OrderedDict(dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]):
def popitem(self, last: bool = ...) -> tuple[_KT, _VT]: ...
def move_to_end(self, key: _KT, last: bool = ...) -> None: ...
def popitem(self, last: bool = True) -> tuple[_KT, _VT]: ...
def move_to_end(self, key: _KT, last: bool = True) -> None: ...
def copy(self: Self) -> Self: ...
def __reversed__(self) -> Iterator[_KT]: ...
def keys(self) -> _odict_keys[_KT, _VT]: ...
@@ -398,7 +398,7 @@ class defaultdict(dict[_KT, _VT], Generic[_KT, _VT]):
class ChainMap(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
maps: list[MutableMapping[_KT, _VT]]
def __init__(self, *maps: MutableMapping[_KT, _VT]) -> None: ...
def new_child(self: Self, m: MutableMapping[_KT, _VT] | None = ...) -> Self: ...
def new_child(self: Self, m: MutableMapping[_KT, _VT] | None = None) -> Self: ...
@property
def parents(self: Self) -> Self: ...
def __setitem__(self, key: _KT, value: _VT) -> None: ...

View File

@@ -11,35 +11,35 @@ class _SupportsSearch(Protocol):
if sys.version_info >= (3, 10):
def compile_dir(
dir: StrPath,
maxlevels: int | None = ...,
ddir: StrPath | None = ...,
force: bool = ...,
rx: _SupportsSearch | None = ...,
quiet: int = ...,
legacy: bool = ...,
optimize: int = ...,
workers: int = ...,
invalidation_mode: PycInvalidationMode | None = ...,
maxlevels: int | None = None,
ddir: StrPath | None = None,
force: bool = False,
rx: _SupportsSearch | None = None,
quiet: int = 0,
legacy: bool = False,
optimize: int = -1,
workers: int = 1,
invalidation_mode: PycInvalidationMode | None = None,
*,
stripdir: StrPath | None = ...,
prependdir: StrPath | None = ...,
limit_sl_dest: StrPath | None = ...,
hardlink_dupes: bool = ...,
stripdir: StrPath | None = None,
prependdir: StrPath | None = None,
limit_sl_dest: StrPath | None = None,
hardlink_dupes: bool = False,
) -> int: ...
def compile_file(
fullname: StrPath,
ddir: StrPath | None = ...,
force: bool = ...,
rx: _SupportsSearch | None = ...,
quiet: int = ...,
legacy: bool = ...,
optimize: int = ...,
invalidation_mode: PycInvalidationMode | None = ...,
ddir: StrPath | None = None,
force: bool = False,
rx: _SupportsSearch | None = None,
quiet: int = 0,
legacy: bool = False,
optimize: int = -1,
invalidation_mode: PycInvalidationMode | None = None,
*,
stripdir: StrPath | None = ...,
prependdir: StrPath | None = ...,
limit_sl_dest: StrPath | None = ...,
hardlink_dupes: bool = ...,
stripdir: StrPath | None = None,
prependdir: StrPath | None = None,
limit_sl_dest: StrPath | None = None,
hardlink_dupes: bool = False,
) -> int: ...
elif sys.version_info >= (3, 9):
@@ -102,10 +102,10 @@ else:
def compile_path(
skip_curdir: bool = ...,
maxlevels: int = ...,
force: bool = ...,
quiet: int = ...,
legacy: bool = ...,
optimize: int = ...,
invalidation_mode: PycInvalidationMode | None = ...,
maxlevels: int = 0,
force: bool = False,
quiet: int = 0,
legacy: bool = False,
optimize: int = -1,
invalidation_mode: PycInvalidationMode | None = None,
) -> int: ...

View File

@@ -40,10 +40,10 @@ class Future(Generic[_T]):
def running(self) -> bool: ...
def done(self) -> bool: ...
def add_done_callback(self, fn: Callable[[Future[_T]], object]) -> None: ...
def result(self, timeout: float | None = ...) -> _T: ...
def result(self, timeout: float | None = None) -> _T: ...
def set_running_or_notify_cancel(self) -> bool: ...
def set_result(self, result: _T) -> None: ...
def exception(self, timeout: float | None = ...) -> BaseException | None: ...
def exception(self, timeout: float | None = None) -> BaseException | None: ...
def set_exception(self, exception: BaseException | None) -> None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
@@ -55,10 +55,10 @@ class Executor:
def submit(self, fn: Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs) -> Future[_T]: ...
def map(
self, fn: Callable[..., _T], *iterables: Iterable[Any], timeout: float | None = ..., chunksize: int = ...
self, fn: Callable[..., _T], *iterables: Iterable[Any], timeout: float | None = None, chunksize: int = 1
) -> Iterator[_T]: ...
if sys.version_info >= (3, 9):
def shutdown(self, wait: bool = ..., *, cancel_futures: bool = ...) -> None: ...
def shutdown(self, wait: bool = True, *, cancel_futures: bool = False) -> None: ...
else:
def shutdown(self, wait: bool = ...) -> None: ...
@@ -67,7 +67,7 @@ class Executor:
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> bool | None: ...
def as_completed(fs: Iterable[Future[_T]], timeout: float | None = ...) -> Iterator[Future[_T]]: ...
def as_completed(fs: Iterable[Future[_T]], timeout: float | None = None) -> Iterator[Future[_T]]: ...
# Ideally this would be a namedtuple, but mypy doesn't support generic tuple types. See #1976
class DoneAndNotDoneFutures(Sequence[set[Future[_T]]]):
@@ -84,7 +84,9 @@ class DoneAndNotDoneFutures(Sequence[set[Future[_T]]]):
@overload
def __getitem__(self, __s: slice) -> DoneAndNotDoneFutures[_T]: ...
def wait(fs: Iterable[Future[_T]], timeout: float | None = ..., return_when: str = ...) -> DoneAndNotDoneFutures[_T]: ...
def wait(
fs: Iterable[Future[_T]], timeout: float | None = None, return_when: str = "ALL_COMPLETED"
) -> DoneAndNotDoneFutures[_T]: ...
class _Waiter:
event: threading.Event

View File

@@ -55,7 +55,7 @@ class _ResultItem:
if sys.version_info >= (3, 11):
exit_pid: int | None
def __init__(
self, work_id: int, exception: Exception | None = ..., result: Any | None = ..., exit_pid: int | None = ...
self, work_id: int, exception: Exception | None = None, result: Any | None = None, exit_pid: int | None = None
) -> None: ...
else:
def __init__(self, work_id: int, exception: Exception | None = ..., result: Any | None = ...) -> None: ...
@@ -74,7 +74,7 @@ class _SafeQueue(Queue[Future[Any]]):
if sys.version_info >= (3, 9):
def __init__(
self,
max_size: int | None = ...,
max_size: int | None = 0,
*,
ctx: BaseContext,
pending_work_items: dict[int, _WorkItem[Any]],
@@ -95,9 +95,9 @@ if sys.version_info >= (3, 11):
def _sendback_result(
result_queue: SimpleQueue[_WorkItem[Any]],
work_id: int,
result: Any | None = ...,
exception: Exception | None = ...,
exit_pid: int | None = ...,
result: Any | None = None,
exception: Exception | None = None,
exit_pid: int | None = None,
) -> None: ...
else:
@@ -111,7 +111,7 @@ if sys.version_info >= (3, 11):
result_queue: SimpleQueue[_ResultItem],
initializer: Callable[..., object] | None,
initargs: tuple[Any, ...],
max_tasks: int | None = ...,
max_tasks: int | None = None,
) -> None: ...
else:
@@ -171,12 +171,12 @@ class ProcessPoolExecutor(Executor):
if sys.version_info >= (3, 11):
def __init__(
self,
max_workers: int | None = ...,
mp_context: BaseContext | None = ...,
initializer: Callable[..., object] | None = ...,
max_workers: int | None = None,
mp_context: BaseContext | None = None,
initializer: Callable[..., object] | None = None,
initargs: tuple[Any, ...] = ...,
*,
max_tasks_per_child: int | None = ...,
max_tasks_per_child: int | None = None,
) -> None: ...
else:
def __init__(

View File

@@ -50,9 +50,9 @@ class ThreadPoolExecutor(Executor):
_work_queue: queue.SimpleQueue[_WorkItem[Any]]
def __init__(
self,
max_workers: int | None = ...,
thread_name_prefix: str = ...,
initializer: Callable[..., object] | None = ...,
max_workers: int | None = None,
thread_name_prefix: str = "",
initializer: Callable[..., object] | None = None,
initargs: tuple[Any, ...] = ...,
) -> None: ...
def _adjust_thread_count(self) -> None: ...

View File

@@ -106,11 +106,11 @@ class RawConfigParser(_Parser):
def has_section(self, section: str) -> bool: ...
def options(self, section: str) -> list[str]: ...
def has_option(self, section: str, option: str) -> bool: ...
def read(self, filenames: StrOrBytesPath | Iterable[StrOrBytesPath], encoding: str | None = ...) -> list[str]: ...
def read_file(self, f: Iterable[str], source: str | None = ...) -> None: ...
def read_string(self, string: str, source: str = ...) -> None: ...
def read_dict(self, dictionary: Mapping[str, Mapping[str, Any]], source: str = ...) -> None: ...
def readfp(self, fp: Iterable[str], filename: str | None = ...) -> None: ...
def read(self, filenames: StrOrBytesPath | Iterable[StrOrBytesPath], encoding: str | None = None) -> list[str]: ...
def read_file(self, f: Iterable[str], source: str | None = None) -> None: ...
def read_string(self, string: str, source: str = "<string>") -> None: ...
def read_dict(self, dictionary: Mapping[str, Mapping[str, Any]], source: str = "<dict>") -> None: ...
def readfp(self, fp: Iterable[str], filename: str | None = None) -> None: ...
# These get* methods are partially applied (with the same names) in
# SectionProxy; the stubs should be kept updated together
@overload
@@ -137,8 +137,8 @@ class RawConfigParser(_Parser):
option: str,
conv: Callable[[str], _T],
*,
raw: bool = ...,
vars: _Section | None = ...,
raw: bool = False,
vars: _Section | None = None,
fallback: _T = ...,
) -> _T: ...
# This is incompatible with MutableMapping so we ignore the type
@@ -150,8 +150,8 @@ class RawConfigParser(_Parser):
def items(self, *, raw: bool = ..., vars: _Section | None = ...) -> ItemsView[str, SectionProxy]: ...
@overload
def items(self, section: str, raw: bool = ..., vars: _Section | None = ...) -> list[tuple[str, str]]: ...
def set(self, section: str, option: str, value: str | None = ...) -> None: ...
def write(self, fp: SupportsWrite[str], space_around_delimiters: bool = ...) -> None: ...
def set(self, section: str, option: str, value: str | None = None) -> None: ...
def write(self, fp: SupportsWrite[str], space_around_delimiters: bool = True) -> None: ...
def remove_option(self, section: str, option: str) -> bool: ...
def remove_section(self, section: str) -> bool: ...
def optionxform(self, optionstr: str) -> str: ...
@@ -181,11 +181,11 @@ class SectionProxy(MutableMapping[str, str]):
def get( # type: ignore[override]
self,
option: str,
fallback: str | None = ...,
fallback: str | None = None,
*,
raw: bool = ...,
vars: _Section | None = ...,
_impl: Any | None = ...,
raw: bool = False,
vars: _Section | None = None,
_impl: Any | None = None,
**kwargs: Any,
) -> str | Any: ... # can be None in RawConfigParser's sections
# These are partially-applied version of the methods with the same names in
@@ -216,7 +216,7 @@ class ConverterMapping(MutableMapping[str, _ConverterCallback | None]):
class Error(Exception):
message: str
def __init__(self, msg: str = ...) -> None: ...
def __init__(self, msg: str = "") -> None: ...
class NoSectionError(Error):
section: str
@@ -226,14 +226,14 @@ class DuplicateSectionError(Error):
section: str
source: str | None
lineno: int | None
def __init__(self, section: str, source: str | None = ..., lineno: int | None = ...) -> None: ...
def __init__(self, section: str, source: str | None = None, lineno: int | None = None) -> None: ...
class DuplicateOptionError(Error):
section: str
option: str
source: str | None
lineno: int | None
def __init__(self, section: str, option: str, source: str | None = ..., lineno: int | None = ...) -> None: ...
def __init__(self, section: str, option: str, source: str | None = None, lineno: int | None = None) -> None: ...
class NoOptionError(Error):
section: str
@@ -257,7 +257,7 @@ class InterpolationSyntaxError(InterpolationError): ...
class ParsingError(Error):
source: str
errors: list[tuple[int, str]]
def __init__(self, source: str | None = ..., filename: str | None = ...) -> None: ...
def __init__(self, source: str | None = None, filename: str | None = None) -> None: ...
def append(self, lineno: int, line: str) -> None: ...
class MissingSectionHeaderError(ParsingError):

View File

@@ -8,7 +8,7 @@ _T = TypeVar("_T")
PyStringMap: Any
# Note: memo and _nil are internal kwargs.
def deepcopy(x: _T, memo: dict[int, Any] | None = ..., _nil: Any = ...) -> _T: ...
def deepcopy(x: _T, memo: dict[int, Any] | None = None, _nil: Any = ...) -> _T: ...
def copy(x: _T) -> _T: ...
class Error(Exception): ...

View File

@@ -10,7 +10,7 @@ __all__ = ["pickle", "constructor", "add_extension", "remove_extension", "clear_
def pickle(
ob_type: type[_T],
pickle_function: Callable[[_T], str | _Reduce[_T]],
constructor_ob: Callable[[_Reduce[_T]], _T] | None = ...,
constructor_ob: Callable[[_Reduce[_T]], _T] | None = None,
) -> None: ...
def constructor(object: Callable[[_Reduce[_T]], _T]) -> None: ...
def add_extension(module: Hashable, name: Hashable, code: SupportsInt) -> None: ...

View File

@@ -8,5 +8,5 @@ if sys.platform != "win32":
METHOD_SHA512: _Method
METHOD_BLOWFISH: _Method
methods: list[_Method]
def mksalt(method: _Method | None = ..., *, rounds: int | None = ...) -> str: ...
def crypt(word: str, salt: str | _Method | None = ...) -> str: ...
def mksalt(method: _Method | None = None, *, rounds: int | None = None) -> str: ...
def crypt(word: str, salt: str | _Method | None = None) -> str: ...

View File

@@ -121,9 +121,9 @@ class DictWriter(Generic[_T]):
self,
f: SupportsWrite[str],
fieldnames: Collection[_T],
restval: Any | None = ...,
extrasaction: Literal["raise", "ignore"] = ...,
dialect: _DialectLike = ...,
restval: Any | None = "",
extrasaction: Literal["raise", "ignore"] = "raise",
dialect: _DialectLike = "excel",
*,
delimiter: str = ...,
quotechar: str | None = ...,
@@ -146,5 +146,5 @@ class DictWriter(Generic[_T]):
class Sniffer:
preferred: list[str]
def sniff(self, sample: str, delimiters: str | None = ...) -> type[Dialect]: ...
def sniff(self, sample: str, delimiters: str | None = None) -> type[Dialect]: ...
def has_header(self, sample: str) -> bool: ...

View File

@@ -25,11 +25,11 @@ class CDLL:
def __init__(
self,
name: str | None,
mode: int = ...,
handle: int | None = ...,
use_errno: bool = ...,
use_last_error: bool = ...,
winmode: int | None = ...,
mode: int = 4,
handle: int | None = None,
use_errno: bool = False,
use_last_error: bool = False,
winmode: int | None = None,
) -> None: ...
else:
def __init__(
@@ -136,11 +136,11 @@ def byref(obj: _CData, offset: int = ...) -> _CArgObject: ...
_CastT = TypeVar("_CastT", bound=_CanCastTo)
def cast(obj: _CData | _CArgObject | int, typ: type[_CastT]) -> _CastT: ...
def create_string_buffer(init: int | bytes, size: int | None = ...) -> Array[c_char]: ...
def create_string_buffer(init: int | bytes, size: int | None = None) -> Array[c_char]: ...
c_buffer = create_string_buffer
def create_unicode_buffer(init: int | str, size: int | None = ...) -> Array[c_wchar]: ...
def create_unicode_buffer(init: int | str, size: int | None = None) -> Array[c_wchar]: ...
if sys.platform == "win32":
def DllCanUnloadNow() -> int: ...
@@ -178,12 +178,12 @@ if sys.platform == "win32":
def set_last_error(value: int) -> int: ...
def sizeof(obj_or_type: _CData | type[_CData]) -> int: ...
def string_at(address: _CVoidConstPLike, size: int = ...) -> bytes: ...
def string_at(address: _CVoidConstPLike, size: int = -1) -> bytes: ...
if sys.platform == "win32":
def WinError(code: int | None = ..., descr: str | None = ...) -> OSError: ...
def wstring_at(address: _CVoidConstPLike, size: int = ...) -> str: ...
def wstring_at(address: _CVoidConstPLike, size: int = -1) -> str: ...
class _SimpleCData(Generic[_T], _CData):
value: _T

View File

@@ -7,7 +7,7 @@ if sys.platform != "win32":
class Textbox:
stripspaces: bool
def __init__(self, win: _CursesWindow, insert_mode: bool = ...) -> None: ...
def edit(self, validate: Callable[[int], int] | None = ...) -> str: ...
def __init__(self, win: _CursesWindow, insert_mode: bool = False) -> None: ...
def edit(self, validate: Callable[[int], int] | None = None) -> str: ...
def do_command(self, ch: str | int) -> None: ...
def gather(self) -> str: ...

View File

@@ -239,17 +239,17 @@ if sys.version_info >= (3, 11):
fields: Iterable[str | tuple[str, type] | tuple[str, type, Any]],
*,
bases: tuple[type, ...] = ...,
namespace: dict[str, Any] | None = ...,
init: bool = ...,
repr: bool = ...,
eq: bool = ...,
order: bool = ...,
unsafe_hash: bool = ...,
frozen: bool = ...,
match_args: bool = ...,
kw_only: bool = ...,
slots: bool = ...,
weakref_slot: bool = ...,
namespace: dict[str, Any] | None = None,
init: bool = True,
repr: bool = True,
eq: bool = True,
order: bool = False,
unsafe_hash: bool = False,
frozen: bool = False,
match_args: bool = True,
kw_only: bool = False,
slots: bool = False,
weakref_slot: bool = False,
) -> type: ...
elif sys.version_info >= (3, 10):

View File

@@ -261,7 +261,7 @@ class datetime(date):
def utcfromtimestamp(cls: type[Self], __t: float) -> Self: ...
if sys.version_info >= (3, 8):
@classmethod
def now(cls: type[Self], tz: _TzInfo | None = ...) -> Self: ...
def now(cls: type[Self], tz: _TzInfo | None = None) -> Self: ...
else:
@overload
@classmethod

View File

@@ -92,4 +92,4 @@ class _error(Exception): ...
error: tuple[type[_error], type[OSError]]
def whichdb(filename: str) -> str: ...
def open(file: str, flag: _TFlags = ..., mode: int = ...) -> _Database: ...
def open(file: str, flag: _TFlags = "r", mode: int = 438) -> _Database: ...

View File

@@ -14,7 +14,7 @@ error = OSError
# any of the three implementations of dbm (dumb, gnu, ndbm), and this
# class is intended to represent the common interface supported by all three.
class _Database(MutableMapping[_KeyType, bytes]):
def __init__(self, filebasename: str, mode: str, flag: str = ...) -> None: ...
def __init__(self, filebasename: str, mode: str, flag: str = "c") -> None: ...
def sync(self) -> None: ...
def iterkeys(self) -> Iterator[bytes]: ... # undocumented
def close(self) -> None: ...
@@ -29,4 +29,4 @@ class _Database(MutableMapping[_KeyType, bytes]):
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> None: ...
def open(file: str, flag: str = ..., mode: int = ...) -> _Database: ...
def open(file: str, flag: str = "c", mode: int = 438) -> _Database: ...

View File

@@ -44,13 +44,13 @@ class SequenceMatcher(Generic[_T]):
def set_seq1(self, a: Sequence[_T]) -> None: ...
def set_seq2(self, b: Sequence[_T]) -> None: ...
if sys.version_info >= (3, 9):
def find_longest_match(self, alo: int = ..., ahi: int | None = ..., blo: int = ..., bhi: int | None = ...) -> Match: ...
def find_longest_match(self, alo: int = 0, ahi: int | None = None, blo: int = 0, bhi: int | None = None) -> Match: ...
else:
def find_longest_match(self, alo: int, ahi: int, blo: int, bhi: int) -> Match: ...
def get_matching_blocks(self) -> list[Match]: ...
def get_opcodes(self) -> list[tuple[str, int, int, int, int]]: ...
def get_grouped_opcodes(self, n: int = ...) -> Iterable[list[tuple[str, int, int, int, int]]]: ...
def get_grouped_opcodes(self, n: int = 3) -> Iterable[list[tuple[str, int, int, int, int]]]: ...
def ratio(self) -> float: ...
def quick_ratio(self) -> float: ...
def real_quick_ratio(self) -> float: ...
@@ -66,62 +66,65 @@ def get_close_matches(
) -> list[Sequence[_T]]: ...
class Differ:
def __init__(self, linejunk: Callable[[str], bool] | None = ..., charjunk: Callable[[str], bool] | None = ...) -> None: ...
def __init__(self, linejunk: Callable[[str], bool] | None = None, charjunk: Callable[[str], bool] | None = None) -> None: ...
def compare(self, a: Sequence[str], b: Sequence[str]) -> Iterator[str]: ...
def IS_LINE_JUNK(line: str, pat: Any = ...) -> bool: ... # pat is undocumented
def IS_CHARACTER_JUNK(ch: str, ws: str = ...) -> bool: ... # ws is undocumented
def IS_CHARACTER_JUNK(ch: str, ws: str = " \t") -> bool: ... # ws is undocumented
def unified_diff(
a: Sequence[str],
b: Sequence[str],
fromfile: str = ...,
tofile: str = ...,
fromfiledate: str = ...,
tofiledate: str = ...,
n: int = ...,
lineterm: str = ...,
fromfile: str = "",
tofile: str = "",
fromfiledate: str = "",
tofiledate: str = "",
n: int = 3,
lineterm: str = "\n",
) -> Iterator[str]: ...
def context_diff(
a: Sequence[str],
b: Sequence[str],
fromfile: str = ...,
tofile: str = ...,
fromfiledate: str = ...,
tofiledate: str = ...,
n: int = ...,
lineterm: str = ...,
fromfile: str = "",
tofile: str = "",
fromfiledate: str = "",
tofiledate: str = "",
n: int = 3,
lineterm: str = "\n",
) -> Iterator[str]: ...
def ndiff(
a: Sequence[str], b: Sequence[str], linejunk: Callable[[str], bool] | None = ..., charjunk: Callable[[str], bool] | None = ...
a: Sequence[str],
b: Sequence[str],
linejunk: Callable[[str], bool] | None = None,
charjunk: Callable[[str], bool] | None = ...,
) -> Iterator[str]: ...
class HtmlDiff:
def __init__(
self,
tabsize: int = ...,
wrapcolumn: int | None = ...,
linejunk: Callable[[str], bool] | None = ...,
tabsize: int = 8,
wrapcolumn: int | None = None,
linejunk: Callable[[str], bool] | None = None,
charjunk: Callable[[str], bool] | None = ...,
) -> None: ...
def make_file(
self,
fromlines: Sequence[str],
tolines: Sequence[str],
fromdesc: str = ...,
todesc: str = ...,
context: bool = ...,
numlines: int = ...,
fromdesc: str = "",
todesc: str = "",
context: bool = False,
numlines: int = 5,
*,
charset: str = ...,
charset: str = "utf-8",
) -> str: ...
def make_table(
self,
fromlines: Sequence[str],
tolines: Sequence[str],
fromdesc: str = ...,
todesc: str = ...,
context: bool = ...,
numlines: int = ...,
fromdesc: str = "",
todesc: str = "",
context: bool = False,
numlines: int = 5,
) -> str: ...
def restore(delta: Iterable[str], which: int) -> Iterator[str]: ...
@@ -133,6 +136,6 @@ def diff_bytes(
tofile: bytes | bytearray = ...,
fromfiledate: bytes | bytearray = ...,
tofiledate: bytes | bytearray = ...,
n: int = ...,
n: int = 3,
lineterm: bytes | bytearray = ...,
) -> Iterator[bytes]: ...

View File

@@ -76,14 +76,14 @@ class Bytecode:
self,
x: _HaveCodeType | str,
*,
first_line: int | None = ...,
current_offset: int | None = ...,
show_caches: bool = ...,
adaptive: bool = ...,
first_line: int | None = None,
current_offset: int | None = None,
show_caches: bool = False,
adaptive: bool = False,
) -> None: ...
@classmethod
def from_traceback(
cls: type[Self], tb: types.TracebackType, *, show_caches: bool = ..., adaptive: bool = ...
cls: type[Self], tb: types.TracebackType, *, show_caches: bool = False, adaptive: bool = False
) -> Self: ...
else:
def __init__(self, x: _HaveCodeType | str, *, first_line: int | None = ..., current_offset: int | None = ...) -> None: ...
@@ -103,12 +103,12 @@ def code_info(x: _HaveCodeType | str) -> str: ...
if sys.version_info >= (3, 11):
def dis(
x: _HaveCodeType | str | bytes | bytearray | None = ...,
x: _HaveCodeType | str | bytes | bytearray | None = None,
*,
file: IO[str] | None = ...,
depth: int | None = ...,
show_caches: bool = ...,
adaptive: bool = ...,
file: IO[str] | None = None,
depth: int | None = None,
show_caches: bool = False,
adaptive: bool = False,
) -> None: ...
else:
@@ -118,16 +118,16 @@ else:
if sys.version_info >= (3, 11):
def disassemble(
co: _HaveCodeType, lasti: int = ..., *, file: IO[str] | None = ..., show_caches: bool = ..., adaptive: bool = ...
co: _HaveCodeType, lasti: int = -1, *, file: IO[str] | None = None, show_caches: bool = False, adaptive: bool = False
) -> None: ...
def disco(
co: _HaveCodeType, lasti: int = ..., *, file: IO[str] | None = ..., show_caches: bool = ..., adaptive: bool = ...
co: _HaveCodeType, lasti: int = -1, *, file: IO[str] | None = None, show_caches: bool = False, adaptive: bool = False
) -> None: ...
def distb(
tb: types.TracebackType | None = ..., *, file: IO[str] | None = ..., show_caches: bool = ..., adaptive: bool = ...
tb: types.TracebackType | None = None, *, file: IO[str] | None = None, show_caches: bool = False, adaptive: bool = False
) -> None: ...
def get_instructions(
x: _HaveCodeType, *, first_line: int | None = ..., show_caches: bool = ..., adaptive: bool = ...
x: _HaveCodeType, *, first_line: int | None = None, show_caches: bool = False, adaptive: bool = False
) -> Iterator[Instruction]: ...
else:
@@ -136,4 +136,4 @@ else:
def distb(tb: types.TracebackType | None = ..., *, file: IO[str] | None = ...) -> None: ...
def get_instructions(x: _HaveCodeType, *, first_line: int | None = ...) -> Iterator[Instruction]: ...
def show_code(co: _HaveCodeType, *, file: IO[str] | None = ...) -> None: ...
def show_code(co: _HaveCodeType, *, file: IO[str] | None = None) -> None: ...

View File

@@ -1,20 +1,20 @@
def make_archive(
base_name: str,
format: str,
root_dir: str | None = ...,
base_dir: str | None = ...,
verbose: int = ...,
dry_run: int = ...,
owner: str | None = ...,
group: str | None = ...,
root_dir: str | None = None,
base_dir: str | None = None,
verbose: int = 0,
dry_run: int = 0,
owner: str | None = None,
group: str | None = None,
) -> str: ...
def make_tarball(
base_name: str,
base_dir: str,
compress: str | None = ...,
verbose: int = ...,
dry_run: int = ...,
owner: str | None = ...,
group: str | None = ...,
compress: str | None = "gzip",
verbose: int = 0,
dry_run: int = 0,
owner: str | None = None,
group: str | None = None,
) -> str: ...
def make_zipfile(base_name: str, base_dir: str, verbose: int = ..., dry_run: int = ...) -> str: ...
def make_zipfile(base_name: str, base_dir: str, verbose: int = 0, dry_run: int = 0) -> str: ...

View File

@@ -8,9 +8,9 @@ def gen_lib_options(
compiler: CCompiler, library_dirs: list[str], runtime_library_dirs: list[str], libraries: list[str]
) -> list[str]: ...
def gen_preprocess_options(macros: list[_Macro], include_dirs: list[str]) -> list[str]: ...
def get_default_compiler(osname: str | None = ..., platform: str | None = ...) -> str: ...
def get_default_compiler(osname: str | None = None, platform: str | None = None) -> str: ...
def new_compiler(
plat: str | None = ..., compiler: str | None = ..., verbose: int = ..., dry_run: int = ..., force: int = ...
plat: str | None = None, compiler: str | None = None, verbose: int = 0, dry_run: int = 0, force: int = 0
) -> CCompiler: ...
def show_compilers() -> None: ...
@@ -25,7 +25,7 @@ class CCompiler:
library_dirs: list[str]
runtime_library_dirs: list[str]
objects: list[str]
def __init__(self, verbose: int = ..., dry_run: int = ..., force: int = ...) -> None: ...
def __init__(self, verbose: int = 0, dry_run: int = 0, force: int = 0) -> None: ...
def add_include_dir(self, dir: str) -> None: ...
def set_include_dirs(self, dirs: list[str]) -> None: ...
def add_library(self, libname: str) -> None: ...
@@ -34,7 +34,7 @@ class CCompiler:
def set_library_dirs(self, dirs: list[str]) -> None: ...
def add_runtime_library_dir(self, dir: str) -> None: ...
def set_runtime_library_dirs(self, dirs: list[str]) -> None: ...
def define_macro(self, name: str, value: str | None = ...) -> None: ...
def define_macro(self, name: str, value: str | None = None) -> None: ...
def undefine_macro(self, name: str) -> None: ...
def add_link_object(self, object: str) -> None: ...
def set_link_objects(self, objects: list[str]) -> None: ...
@@ -43,10 +43,10 @@ class CCompiler:
def has_function(
self,
funcname: str,
includes: list[str] | None = ...,
include_dirs: list[str] | None = ...,
libraries: list[str] | None = ...,
library_dirs: list[str] | None = ...,
includes: list[str] | None = None,
include_dirs: list[str] | None = None,
libraries: list[str] | None = None,
library_dirs: list[str] | None = None,
) -> bool: ...
def library_dir_option(self, dir: str) -> str: ...
def library_option(self, lib: str) -> str: ...
@@ -55,98 +55,98 @@ class CCompiler:
def compile(
self,
sources: list[str],
output_dir: str | None = ...,
macros: _Macro | None = ...,
include_dirs: list[str] | None = ...,
output_dir: str | None = None,
macros: _Macro | None = None,
include_dirs: list[str] | None = None,
debug: bool = ...,
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
depends: list[str] | None = ...,
extra_preargs: list[str] | None = None,
extra_postargs: list[str] | None = None,
depends: list[str] | None = None,
) -> list[str]: ...
def create_static_lib(
self,
objects: list[str],
output_libname: str,
output_dir: str | None = ...,
output_dir: str | None = None,
debug: bool = ...,
target_lang: str | None = ...,
target_lang: str | None = None,
) -> None: ...
def link(
self,
target_desc: str,
objects: list[str],
output_filename: str,
output_dir: str | None = ...,
libraries: list[str] | None = ...,
library_dirs: list[str] | None = ...,
runtime_library_dirs: list[str] | None = ...,
export_symbols: list[str] | None = ...,
output_dir: str | None = None,
libraries: list[str] | None = None,
library_dirs: list[str] | None = None,
runtime_library_dirs: list[str] | None = None,
export_symbols: list[str] | None = None,
debug: bool = ...,
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
build_temp: str | None = ...,
target_lang: str | None = ...,
extra_preargs: list[str] | None = None,
extra_postargs: list[str] | None = None,
build_temp: str | None = None,
target_lang: str | None = None,
) -> None: ...
def link_executable(
self,
objects: list[str],
output_progname: str,
output_dir: str | None = ...,
libraries: list[str] | None = ...,
library_dirs: list[str] | None = ...,
runtime_library_dirs: list[str] | None = ...,
output_dir: str | None = None,
libraries: list[str] | None = None,
library_dirs: list[str] | None = None,
runtime_library_dirs: list[str] | None = None,
debug: bool = ...,
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
target_lang: str | None = ...,
extra_preargs: list[str] | None = None,
extra_postargs: list[str] | None = None,
target_lang: str | None = None,
) -> None: ...
def link_shared_lib(
self,
objects: list[str],
output_libname: str,
output_dir: str | None = ...,
libraries: list[str] | None = ...,
library_dirs: list[str] | None = ...,
runtime_library_dirs: list[str] | None = ...,
export_symbols: list[str] | None = ...,
output_dir: str | None = None,
libraries: list[str] | None = None,
library_dirs: list[str] | None = None,
runtime_library_dirs: list[str] | None = None,
export_symbols: list[str] | None = None,
debug: bool = ...,
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
build_temp: str | None = ...,
target_lang: str | None = ...,
extra_preargs: list[str] | None = None,
extra_postargs: list[str] | None = None,
build_temp: str | None = None,
target_lang: str | None = None,
) -> None: ...
def link_shared_object(
self,
objects: list[str],
output_filename: str,
output_dir: str | None = ...,
libraries: list[str] | None = ...,
library_dirs: list[str] | None = ...,
runtime_library_dirs: list[str] | None = ...,
export_symbols: list[str] | None = ...,
output_dir: str | None = None,
libraries: list[str] | None = None,
library_dirs: list[str] | None = None,
runtime_library_dirs: list[str] | None = None,
export_symbols: list[str] | None = None,
debug: bool = ...,
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
build_temp: str | None = ...,
target_lang: str | None = ...,
extra_preargs: list[str] | None = None,
extra_postargs: list[str] | None = None,
build_temp: str | None = None,
target_lang: str | None = None,
) -> None: ...
def preprocess(
self,
source: str,
output_file: str | None = ...,
macros: list[_Macro] | None = ...,
include_dirs: list[str] | None = ...,
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
output_file: str | None = None,
macros: list[_Macro] | None = None,
include_dirs: list[str] | None = None,
extra_preargs: list[str] | None = None,
extra_postargs: list[str] | None = None,
) -> None: ...
def executable_filename(self, basename: str, strip_dir: int = ..., output_dir: str = ...) -> str: ...
def library_filename(self, libname: str, lib_type: str = ..., strip_dir: int = ..., output_dir: str = ...) -> str: ...
def object_filenames(self, source_filenames: list[str], strip_dir: int = ..., output_dir: str = ...) -> list[str]: ...
def shared_object_filename(self, basename: str, strip_dir: int = ..., output_dir: str = ...) -> str: ...
def execute(self, func: Callable[..., object], args: tuple[Any, ...], msg: str | None = ..., level: int = ...) -> None: ...
def executable_filename(self, basename: str, strip_dir: int = 0, output_dir: str = "") -> str: ...
def library_filename(self, libname: str, lib_type: str = "static", strip_dir: int = 0, output_dir: str = "") -> str: ...
def object_filenames(self, source_filenames: list[str], strip_dir: int = 0, output_dir: str = "") -> list[str]: ...
def shared_object_filename(self, basename: str, strip_dir: int = 0, output_dir: str = "") -> str: ...
def execute(self, func: Callable[..., object], args: tuple[Any, ...], msg: str | None = None, level: int = 1) -> None: ...
def spawn(self, cmd: list[str]) -> None: ...
def mkpath(self, name: str, mode: int = ...) -> None: ...
def mkpath(self, name: str, mode: int = 511) -> None: ...
def move_file(self, src: str, dst: str) -> str: ...
def announce(self, msg: str, level: int = ...) -> None: ...
def announce(self, msg: str, level: int = 1) -> None: ...
def warn(self, msg: str) -> None: ...
def debug_print(self, msg: str) -> None: ...

View File

@@ -12,49 +12,43 @@ class Command:
def finalize_options(self) -> None: ...
@abstractmethod
def run(self) -> None: ...
def announce(self, msg: str, level: int = ...) -> None: ...
def announce(self, msg: str, level: int = 1) -> None: ...
def debug_print(self, msg: str) -> None: ...
def ensure_string(self, option: str, default: str | None = ...) -> None: ...
def ensure_string(self, option: str, default: str | None = None) -> None: ...
def ensure_string_list(self, option: str | list[str]) -> None: ...
def ensure_filename(self, option: str) -> None: ...
def ensure_dirname(self, option: str) -> None: ...
def get_command_name(self) -> str: ...
def set_undefined_options(self, src_cmd: str, *option_pairs: tuple[str, str]) -> None: ...
def get_finalized_command(self, command: str, create: int = ...) -> Command: ...
def reinitialize_command(self, command: Command | str, reinit_subcommands: int = ...) -> Command: ...
def get_finalized_command(self, command: str, create: int = 1) -> Command: ...
def reinitialize_command(self, command: Command | str, reinit_subcommands: int = 0) -> Command: ...
def run_command(self, command: str) -> None: ...
def get_sub_commands(self) -> list[str]: ...
def warn(self, msg: str) -> None: ...
def execute(self, func: Callable[..., object], args: Iterable[Any], msg: str | None = ..., level: int = ...) -> None: ...
def mkpath(self, name: str, mode: int = ...) -> None: ...
def execute(self, func: Callable[..., object], args: Iterable[Any], msg: str | None = None, level: int = 1) -> None: ...
def mkpath(self, name: str, mode: int = 511) -> None: ...
def copy_file(
self,
infile: str,
outfile: str,
preserve_mode: int = ...,
preserve_times: int = ...,
link: str | None = ...,
level: Any = ...,
self, infile: str, outfile: str, preserve_mode: int = 1, preserve_times: int = 1, link: str | None = None, level: Any = 1
) -> tuple[str, bool]: ... # level is not used
def copy_tree(
self,
infile: str,
outfile: str,
preserve_mode: int = ...,
preserve_times: int = ...,
preserve_symlinks: int = ...,
level: Any = ...,
preserve_mode: int = 1,
preserve_times: int = 1,
preserve_symlinks: int = 0,
level: Any = 1,
) -> list[str]: ... # level is not used
def move_file(self, src: str, dst: str, level: Any = ...) -> str: ... # level is not used
def spawn(self, cmd: Iterable[str], search_path: int = ..., level: Any = ...) -> None: ... # level is not used
def move_file(self, src: str, dst: str, level: Any = 1) -> str: ... # level is not used
def spawn(self, cmd: Iterable[str], search_path: int = 1, level: Any = 1) -> None: ... # level is not used
def make_archive(
self,
base_name: str,
format: str,
root_dir: str | None = ...,
base_dir: str | None = ...,
owner: str | None = ...,
group: str | None = ...,
root_dir: str | None = None,
base_dir: str | None = None,
owner: str | None = None,
group: str | None = None,
) -> str: ...
def make_file(
self,
@@ -62,7 +56,7 @@ class Command:
outfile: str,
func: Callable[..., object],
args: list[Any],
exec_msg: str | None = ...,
skip_msg: str | None = ...,
level: Any = ...,
exec_msg: str | None = None,
skip_msg: str | None = None,
level: Any = 1,
) -> None: ... # level is not used

View File

@@ -32,7 +32,7 @@ class build_py(Command):
def find_all_modules(self): ...
def get_source_files(self): ...
def get_module_outfile(self, build_dir, package, module): ...
def get_outputs(self, include_bytecode: int = ...): ...
def get_outputs(self, include_bytecode: int = 1): ...
def build_module(self, module, module_file, package): ...
def build_modules(self) -> None: ...
def build_packages(self) -> None: ...

View File

@@ -24,60 +24,60 @@ class config(Command):
def run(self) -> None: ...
def try_cpp(
self,
body: str | None = ...,
headers: Sequence[str] | None = ...,
include_dirs: Sequence[str] | None = ...,
lang: str = ...,
body: str | None = None,
headers: Sequence[str] | None = None,
include_dirs: Sequence[str] | None = None,
lang: str = "c",
) -> bool: ...
def search_cpp(
self,
pattern: Pattern[str] | str,
body: str | None = ...,
headers: Sequence[str] | None = ...,
include_dirs: Sequence[str] | None = ...,
lang: str = ...,
body: str | None = None,
headers: Sequence[str] | None = None,
include_dirs: Sequence[str] | None = None,
lang: str = "c",
) -> bool: ...
def try_compile(
self, body: str, headers: Sequence[str] | None = ..., include_dirs: Sequence[str] | None = ..., lang: str = ...
self, body: str, headers: Sequence[str] | None = None, include_dirs: Sequence[str] | None = None, lang: str = "c"
) -> bool: ...
def try_link(
self,
body: str,
headers: Sequence[str] | None = ...,
include_dirs: Sequence[str] | None = ...,
libraries: Sequence[str] | None = ...,
library_dirs: Sequence[str] | None = ...,
lang: str = ...,
headers: Sequence[str] | None = None,
include_dirs: Sequence[str] | None = None,
libraries: Sequence[str] | None = None,
library_dirs: Sequence[str] | None = None,
lang: str = "c",
) -> bool: ...
def try_run(
self,
body: str,
headers: Sequence[str] | None = ...,
include_dirs: Sequence[str] | None = ...,
libraries: Sequence[str] | None = ...,
library_dirs: Sequence[str] | None = ...,
lang: str = ...,
headers: Sequence[str] | None = None,
include_dirs: Sequence[str] | None = None,
libraries: Sequence[str] | None = None,
library_dirs: Sequence[str] | None = None,
lang: str = "c",
) -> bool: ...
def check_func(
self,
func: str,
headers: Sequence[str] | None = ...,
include_dirs: Sequence[str] | None = ...,
libraries: Sequence[str] | None = ...,
library_dirs: Sequence[str] | None = ...,
decl: int = ...,
call: int = ...,
headers: Sequence[str] | None = None,
include_dirs: Sequence[str] | None = None,
libraries: Sequence[str] | None = None,
library_dirs: Sequence[str] | None = None,
decl: int = 0,
call: int = 0,
) -> bool: ...
def check_lib(
self,
library: str,
library_dirs: Sequence[str] | None = ...,
headers: Sequence[str] | None = ...,
include_dirs: Sequence[str] | None = ...,
library_dirs: Sequence[str] | None = None,
headers: Sequence[str] | None = None,
include_dirs: Sequence[str] | None = None,
other_libraries: list[str] = ...,
) -> bool: ...
def check_header(
self, header: str, include_dirs: Sequence[str] | None = ..., library_dirs: Sequence[str] | None = ..., lang: str = ...
self, header: str, include_dirs: Sequence[str] | None = None, library_dirs: Sequence[str] | None = None, lang: str = "c"
) -> bool: ...
def dump_file(filename: str, head: Any | None = ...) -> None: ...
def dump_file(filename: str, head: Any | None = None) -> None: ...

View File

@@ -15,4 +15,4 @@ class register(PyPIRCCommand):
def verify_metadata(self) -> None: ...
def send_metadata(self) -> None: ...
def build_post_data(self, action): ...
def post_to_server(self, data, auth: Any | None = ...): ...
def post_to_server(self, data, auth: Any | None = None): ...

View File

@@ -46,4 +46,4 @@ def setup(
fullname: str = ...,
**attrs: Any,
) -> None: ...
def run_setup(script_name: str, script_args: list[str] | None = ..., stop_after: str = ...) -> Distribution: ...
def run_setup(script_name: str, script_args: list[str] | None = None, stop_after: str = "run") -> Distribution: ...

View File

@@ -1,3 +1,3 @@
def newer(source: str, target: str) -> bool: ...
def newer_pairwise(sources: list[str], targets: list[str]) -> list[tuple[str, str]]: ...
def newer_group(sources: list[str], target: str, missing: str = ...) -> bool: ...
def newer_group(sources: list[str], target: str, missing: str = "error") -> bool: ...

View File

@@ -1,13 +1,13 @@
def mkpath(name: str, mode: int = ..., verbose: int = ..., dry_run: int = ...) -> list[str]: ...
def create_tree(base_dir: str, files: list[str], mode: int = ..., verbose: int = ..., dry_run: int = ...) -> None: ...
def mkpath(name: str, mode: int = 511, verbose: int = 1, dry_run: int = 0) -> list[str]: ...
def create_tree(base_dir: str, files: list[str], mode: int = 511, verbose: int = 1, dry_run: int = 0) -> None: ...
def copy_tree(
src: str,
dst: str,
preserve_mode: int = ...,
preserve_times: int = ...,
preserve_symlinks: int = ...,
update: int = ...,
verbose: int = ...,
dry_run: int = ...,
preserve_mode: int = 1,
preserve_times: int = 1,
preserve_symlinks: int = 0,
update: int = 0,
verbose: int = 1,
dry_run: int = 0,
) -> list[str]: ...
def remove_tree(directory: str, verbose: int = ..., dry_run: int = ...) -> None: ...
def remove_tree(directory: str, verbose: int = 1, dry_run: int = 0) -> None: ...

View File

@@ -4,7 +4,7 @@ from distutils.cmd import Command
from typing import IO, Any
class DistributionMetadata:
def __init__(self, path: FileDescriptorOrPath | None = ...) -> None: ...
def __init__(self, path: FileDescriptorOrPath | None = None) -> None: ...
name: str | None
version: str | None
author: str | None
@@ -53,7 +53,7 @@ class DistributionMetadata:
class Distribution:
cmdclass: dict[str, type[Command]]
metadata: DistributionMetadata
def __init__(self, attrs: Mapping[str, Any] | None = ...) -> None: ...
def __init__(self, attrs: Mapping[str, Any] | None = None) -> None: ...
def get_option_dict(self, command: str) -> dict[str, tuple[str, str]]: ...
def parse_config_files(self, filenames: Iterable[str] | None = ...) -> None: ...
def parse_config_files(self, filenames: Iterable[str] | None = None) -> None: ...
def get_command_obj(self, command: str, create: bool = ...) -> Command | None: ...

View File

@@ -11,14 +11,14 @@ def fancy_getopt(
def wrap_text(text: str, width: int) -> list[str]: ...
class FancyGetopt:
def __init__(self, option_table: list[_Option] | None = ...) -> None: ...
def __init__(self, option_table: list[_Option] | None = None) -> None: ...
# TODO kinda wrong, `getopt(object=object())` is invalid
@overload
def getopt(self, args: list[str] | None = ...) -> _GR: ...
@overload
def getopt(self, args: list[str] | None, object: Any) -> list[str]: ...
def get_option_order(self) -> list[tuple[str, str]]: ...
def generate_help(self, header: str | None = ...) -> list[str]: ...
def generate_help(self, header: str | None = None) -> list[str]: ...
class OptionDummy:
def __init__(self, options: Iterable[str] = ...) -> None: ...

View File

@@ -6,7 +6,7 @@ def copy_file(
preserve_mode: bool = ...,
preserve_times: bool = ...,
update: bool = ...,
link: str | None = ...,
link: str | None = None,
verbose: bool = ...,
dry_run: bool = ...,
) -> tuple[str, str]: ...

View File

@@ -7,9 +7,9 @@ from typing_extensions import Literal
class FileList:
allfiles: Iterable[str] | None
files: list[str]
def __init__(self, warn: None = ..., debug_print: None = ...) -> None: ...
def __init__(self, warn: None = None, debug_print: None = None) -> None: ...
def set_allfiles(self, allfiles: Iterable[str]) -> None: ...
def findall(self, dir: str = ...) -> None: ...
def findall(self, dir: str = ".") -> None: ...
def debug_print(self, msg: str) -> None: ...
def append(self, item: str) -> None: ...
def extend(self, items: Iterable[str]) -> None: ...
@@ -37,7 +37,7 @@ class FileList:
self, pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: int = ...
) -> bool: ...
def findall(dir: str = ...) -> list[str]: ...
def findall(dir: str = ".") -> list[str]: ...
def glob_to_re(pattern: str) -> str: ...
@overload
def translate_pattern(

View File

@@ -7,7 +7,7 @@ ERROR: int
FATAL: int
class Log:
def __init__(self, threshold: int = ...) -> None: ...
def __init__(self, threshold: int = 3) -> None: ...
def log(self, level: int, msg: str, *args: Any) -> None: ...
def debug(self, msg: str, *args: Any) -> None: ...
def info(self, msg: str, *args: Any) -> None: ...

View File

@@ -1,2 +1,2 @@
def spawn(cmd: list[str], search_path: bool = ..., verbose: bool = ..., dry_run: bool = ...) -> None: ...
def find_executable(executable: str, path: str | None = ...) -> str | None: ...
def find_executable(executable: str, path: str | None = None) -> str | None: ...

View File

@@ -8,6 +8,6 @@ def get_config_var(name: str) -> int | str | None: ...
def get_config_vars(*args: str) -> Mapping[str, int | str]: ...
def get_config_h_filename() -> str: ...
def get_makefile_filename() -> str: ...
def get_python_inc(plat_specific: bool = ..., prefix: str | None = ...) -> str: ...
def get_python_lib(plat_specific: bool = ..., standard_lib: bool = ..., prefix: str | None = ...) -> str: ...
def get_python_inc(plat_specific: bool = ..., prefix: str | None = None) -> str: ...
def get_python_lib(plat_specific: bool = ..., standard_lib: bool = ..., prefix: str | None = None) -> str: ...
def customize_compiler(compiler: CCompiler) -> None: ...

View File

@@ -3,8 +3,8 @@ from typing import IO
class TextFile:
def __init__(
self,
filename: str | None = ...,
file: IO[str] | None = ...,
filename: str | None = None,
file: IO[str] | None = None,
*,
strip_comments: bool = ...,
lstrip_ws: bool = ...,
@@ -15,7 +15,7 @@ class TextFile:
) -> None: ...
def open(self, filename: str) -> None: ...
def close(self) -> None: ...
def warn(self, msg: str, line: list[int] | tuple[int, int] | int | None = ...) -> None: ...
def warn(self, msg: str, line: list[int] | tuple[int, int] | int | None = None) -> None: ...
def readline(self) -> str | None: ...
def readlines(self) -> list[str]: ...
def unreadline(self, line: str) -> str: ...

View File

@@ -10,18 +10,18 @@ def check_environ() -> None: ...
def subst_vars(s: str, local_vars: Mapping[str, str]) -> None: ...
def split_quoted(s: str) -> list[str]: ...
def execute(
func: Callable[..., object], args: tuple[Any, ...], msg: str | None = ..., verbose: bool = ..., dry_run: bool = ...
func: Callable[..., object], args: tuple[Any, ...], msg: str | None = None, verbose: bool = ..., dry_run: bool = ...
) -> None: ...
def strtobool(val: str) -> Literal[0, 1]: ...
def byte_compile(
py_files: list[str],
optimize: int = ...,
optimize: int = 0,
force: bool = ...,
prefix: str | None = ...,
base_dir: str | None = ...,
prefix: str | None = None,
base_dir: str | None = None,
verbose: bool = ...,
dry_run: bool = ...,
direct: bool | None = ...,
direct: bool | None = None,
) -> None: ...
def rfc822_escape(header: str) -> str: ...
def run_2to3(

View File

@@ -9,7 +9,7 @@ class Version:
def __gt__(self: Self, other: Self | str) -> bool: ...
def __ge__(self: Self, other: Self | str) -> bool: ...
@abstractmethod
def __init__(self, vstring: str | None = ...) -> None: ...
def __init__(self, vstring: str | None = None) -> None: ...
@abstractmethod
def parse(self: Self, vstring: str) -> Self: ...
@abstractmethod
@@ -21,7 +21,7 @@ class StrictVersion(Version):
version_re: Pattern[str]
version: tuple[int, int, int]
prerelease: tuple[str, int] | None
def __init__(self, vstring: str | None = ...) -> None: ...
def __init__(self, vstring: str | None = None) -> None: ...
def parse(self: Self, vstring: str) -> Self: ...
def __str__(self) -> str: ... # noqa: Y029
def _cmp(self: Self, other: Self | str) -> bool: ...
@@ -30,7 +30,7 @@ class LooseVersion(Version):
component_re: Pattern[str]
vstring: str
version: tuple[str | int, ...]
def __init__(self, vstring: str | None = ...) -> None: ...
def __init__(self, vstring: str | None = None) -> None: ...
def parse(self: Self, vstring: str) -> Self: ...
def __str__(self) -> str: ... # noqa: Y029
def _cmp(self: Self, other: Self | str) -> bool: ...

View File

@@ -80,10 +80,10 @@ class Example:
self,
source: str,
want: str,
exc_msg: str | None = ...,
lineno: int = ...,
indent: int = ...,
options: dict[int, bool] | None = ...,
exc_msg: str | None = None,
lineno: int = 0,
indent: int = 0,
options: dict[int, bool] | None = None,
) -> None: ...
def __eq__(self, other: object) -> bool: ...
@@ -107,21 +107,21 @@ class DocTest:
def __eq__(self, other: object) -> bool: ...
class DocTestParser:
def parse(self, string: str, name: str = ...) -> list[str | Example]: ...
def parse(self, string: str, name: str = "<string>") -> list[str | Example]: ...
def get_doctest(self, string: str, globs: dict[str, Any], name: str, filename: str | None, lineno: int | None) -> DocTest: ...
def get_examples(self, string: str, name: str = ...) -> list[Example]: ...
def get_examples(self, string: str, name: str = "<string>") -> list[Example]: ...
class DocTestFinder:
def __init__(
self, verbose: bool = ..., parser: DocTestParser = ..., recurse: bool = ..., exclude_empty: bool = ...
self, verbose: bool = False, parser: DocTestParser = ..., recurse: bool = True, exclude_empty: bool = True
) -> None: ...
def find(
self,
obj: object,
name: str | None = ...,
module: None | bool | types.ModuleType = ...,
globs: dict[str, Any] | None = ...,
extraglobs: dict[str, Any] | None = ...,
name: str | None = None,
module: None | bool | types.ModuleType = None,
globs: dict[str, Any] | None = None,
extraglobs: dict[str, Any] | None = None,
) -> list[DocTest]: ...
_Out: TypeAlias = Callable[[str], object]
@@ -133,15 +133,15 @@ class DocTestRunner:
tries: int
failures: int
test: DocTest
def __init__(self, checker: OutputChecker | None = ..., verbose: bool | None = ..., optionflags: int = ...) -> None: ...
def __init__(self, checker: OutputChecker | None = None, verbose: bool | None = None, optionflags: int = 0) -> None: ...
def report_start(self, out: _Out, test: DocTest, example: Example) -> None: ...
def report_success(self, out: _Out, test: DocTest, example: Example, got: str) -> None: ...
def report_failure(self, out: _Out, test: DocTest, example: Example, got: str) -> None: ...
def report_unexpected_exception(self, out: _Out, test: DocTest, example: Example, exc_info: ExcInfo) -> None: ...
def run(
self, test: DocTest, compileflags: int | None = ..., out: _Out | None = ..., clear_globs: bool = ...
self, test: DocTest, compileflags: int | None = None, out: _Out | None = None, clear_globs: bool = True
) -> TestResults: ...
def summarize(self, verbose: bool | None = ...) -> TestResults: ...
def summarize(self, verbose: bool | None = None) -> TestResults: ...
def merge(self, other: DocTestRunner) -> None: ...
class OutputChecker:
@@ -165,32 +165,37 @@ class DebugRunner(DocTestRunner): ...
master: DocTestRunner | None
def testmod(
m: types.ModuleType | None = ...,
name: str | None = ...,
globs: dict[str, Any] | None = ...,
verbose: bool | None = ...,
report: bool = ...,
optionflags: int = ...,
extraglobs: dict[str, Any] | None = ...,
raise_on_error: bool = ...,
exclude_empty: bool = ...,
m: types.ModuleType | None = None,
name: str | None = None,
globs: dict[str, Any] | None = None,
verbose: bool | None = None,
report: bool = True,
optionflags: int = 0,
extraglobs: dict[str, Any] | None = None,
raise_on_error: bool = False,
exclude_empty: bool = False,
) -> TestResults: ...
def testfile(
filename: str,
module_relative: bool = ...,
name: str | None = ...,
package: None | str | types.ModuleType = ...,
globs: dict[str, Any] | None = ...,
verbose: bool | None = ...,
report: bool = ...,
optionflags: int = ...,
extraglobs: dict[str, Any] | None = ...,
raise_on_error: bool = ...,
module_relative: bool = True,
name: str | None = None,
package: None | str | types.ModuleType = None,
globs: dict[str, Any] | None = None,
verbose: bool | None = None,
report: bool = True,
optionflags: int = 0,
extraglobs: dict[str, Any] | None = None,
raise_on_error: bool = False,
parser: DocTestParser = ...,
encoding: str | None = ...,
encoding: str | None = None,
) -> TestResults: ...
def run_docstring_examples(
f: object, globs: dict[str, Any], verbose: bool = ..., name: str = ..., compileflags: int | None = ..., optionflags: int = ...
f: object,
globs: dict[str, Any],
verbose: bool = False,
name: str = "NoName",
compileflags: int | None = None,
optionflags: int = 0,
) -> None: ...
def set_unittest_reportflags(flags: int) -> int: ...
@@ -198,10 +203,10 @@ class DocTestCase(unittest.TestCase):
def __init__(
self,
test: DocTest,
optionflags: int = ...,
setUp: Callable[[DocTest], Any] | None = ...,
tearDown: Callable[[DocTest], Any] | None = ...,
checker: OutputChecker | None = ...,
optionflags: int = 0,
setUp: Callable[[DocTest], Any] | None = None,
tearDown: Callable[[DocTest], Any] | None = None,
checker: OutputChecker | None = None,
) -> None: ...
def runTest(self) -> None: ...
def format_failure(self, err: str) -> str: ...
@@ -214,10 +219,10 @@ class SkipDocTestCase(DocTestCase):
class _DocTestSuite(unittest.TestSuite): ...
def DocTestSuite(
module: None | str | types.ModuleType = ...,
globs: dict[str, Any] | None = ...,
extraglobs: dict[str, Any] | None = ...,
test_finder: DocTestFinder | None = ...,
module: None | str | types.ModuleType = None,
globs: dict[str, Any] | None = None,
extraglobs: dict[str, Any] | None = None,
test_finder: DocTestFinder | None = None,
**options: Any,
) -> _DocTestSuite: ...
@@ -225,16 +230,16 @@ class DocFileCase(DocTestCase): ...
def DocFileTest(
path: str,
module_relative: bool = ...,
package: None | str | types.ModuleType = ...,
globs: dict[str, Any] | None = ...,
module_relative: bool = True,
package: None | str | types.ModuleType = None,
globs: dict[str, Any] | None = None,
parser: DocTestParser = ...,
encoding: str | None = ...,
encoding: str | None = None,
**options: Any,
) -> DocFileCase: ...
def DocFileSuite(*paths: str, **kw: Any) -> _DocTestSuite: ...
def script_from_examples(s: str) -> str: ...
def testsource(module: None | str | types.ModuleType, name: str) -> str: ...
def debug_src(src: str, pm: bool = ..., globs: dict[str, Any] | None = ...) -> None: ...
def debug_script(src: str, pm: bool = ..., globs: dict[str, Any] | None = ...) -> None: ...
def debug(module: None | str | types.ModuleType, name: str, pm: bool = ...) -> None: ...
def debug_src(src: str, pm: bool = False, globs: dict[str, Any] | None = None) -> None: ...
def debug_script(src: str, pm: bool = False, globs: dict[str, Any] | None = None) -> None: ...
def debug(module: None | str | types.ModuleType, name: str, pm: bool = False) -> None: ...

View File

@@ -39,8 +39,8 @@ class TokenList(list[TokenList | Terminal]):
@property
def comments(self) -> list[str]: ...
def fold(self, *, policy: Policy) -> str: ...
def pprint(self, indent: str = ...) -> None: ...
def ppstr(self, indent: str = ...) -> str: ...
def pprint(self, indent: str = "") -> None: ...
def ppstr(self, indent: str = "") -> str: ...
class WhiteSpaceTokenList(TokenList): ...

View File

@@ -3,10 +3,10 @@ __all__ = ["body_decode", "body_encode", "decode", "decodestring", "header_encod
from _typeshed import ReadableBuffer
def header_length(bytearray: str | bytes | bytearray) -> int: ...
def header_encode(header_bytes: str | ReadableBuffer, charset: str = ...) -> str: ...
def header_encode(header_bytes: str | ReadableBuffer, charset: str = "iso-8859-1") -> str: ...
# First argument should be a buffer that supports slicing and len().
def body_encode(s: bytes | bytearray, maxlinelen: int = ..., eol: str = ...) -> str: ...
def body_encode(s: bytes | bytearray, maxlinelen: int = 76, eol: str = "\n") -> str: ...
def decode(string: str | ReadableBuffer) -> bytes: ...
body_decode = decode

View File

@@ -13,7 +13,7 @@ class Charset:
output_charset: str | None
input_codec: str | None
output_codec: str | None
def __init__(self, input_charset: str = ...) -> None: ...
def __init__(self, input_charset: str = "us-ascii") -> None: ...
def get_body_encoding(self) -> str: ...
def get_output_charset(self) -> str | None: ...
def header_encode(self, string: str) -> str: ...
@@ -23,7 +23,7 @@ class Charset:
def __ne__(self, __other: object) -> bool: ...
def add_charset(
charset: str, header_enc: int | None = ..., body_enc: int | None = ..., output_charset: str | None = ...
charset: str, header_enc: int | None = None, body_enc: int | None = None, output_charset: str | None = None
) -> None: ...
def add_alias(alias: str, canonical: str) -> None: ...
def add_codec(charset: str, codecname: str) -> None: ...

View File

@@ -8,7 +8,7 @@ class MultipartConversionError(MessageError, TypeError): ...
class CharsetError(MessageError): ...
class MessageDefect(ValueError):
def __init__(self, line: str | None = ...) -> None: ...
def __init__(self, line: str | None = None) -> None: ...
class NoBoundaryInMultipartDefect(MessageDefect): ...
class StartBoundaryNotFoundDefect(MessageDefect): ...

View File

@@ -10,12 +10,12 @@ class Generator:
def __init__(
self,
outfp: SupportsWrite[str],
mangle_from_: bool | None = ...,
maxheaderlen: int | None = ...,
mangle_from_: bool | None = None,
maxheaderlen: int | None = None,
*,
policy: Policy | None = ...,
policy: Policy | None = None,
) -> None: ...
def flatten(self, msg: Message, unixfrom: bool = ..., linesep: str | None = ...) -> None: ...
def flatten(self, msg: Message, unixfrom: bool = False, linesep: str | None = None) -> None: ...
class BytesGenerator:
def clone(self, fp: SupportsWrite[bytes]) -> BytesGenerator: ...
@@ -23,20 +23,20 @@ class BytesGenerator:
def __init__(
self,
outfp: SupportsWrite[bytes],
mangle_from_: bool | None = ...,
maxheaderlen: int | None = ...,
mangle_from_: bool | None = None,
maxheaderlen: int | None = None,
*,
policy: Policy | None = ...,
policy: Policy | None = None,
) -> None: ...
def flatten(self, msg: Message, unixfrom: bool = ..., linesep: str | None = ...) -> None: ...
def flatten(self, msg: Message, unixfrom: bool = False, linesep: str | None = None) -> None: ...
class DecodedGenerator(Generator):
def __init__(
self,
outfp: SupportsWrite[str],
mangle_from_: bool | None = ...,
maxheaderlen: int | None = ...,
fmt: str | None = ...,
mangle_from_: bool | None = None,
maxheaderlen: int | None = None,
fmt: str | None = None,
*,
policy: Policy | None = ...,
policy: Policy | None = None,
) -> None: ...

View File

@@ -7,15 +7,15 @@ __all__ = ["Header", "decode_header", "make_header"]
class Header:
def __init__(
self,
s: bytes | bytearray | str | None = ...,
charset: Charset | str | None = ...,
maxlinelen: int | None = ...,
header_name: str | None = ...,
continuation_ws: str = ...,
errors: str = ...,
s: bytes | bytearray | str | None = None,
charset: Charset | str | None = None,
maxlinelen: int | None = None,
header_name: str | None = None,
continuation_ws: str = " ",
errors: str = "strict",
) -> None: ...
def append(self, s: bytes | bytearray | str, charset: Charset | str | None = ..., errors: str = ...) -> None: ...
def encode(self, splitchars: str = ..., maxlinelen: int | None = ..., linesep: str = ...) -> str: ...
def append(self, s: bytes | bytearray | str, charset: Charset | str | None = None, errors: str = "strict") -> None: ...
def encode(self, splitchars: str = ";, \t", maxlinelen: int | None = None, linesep: str = "\n") -> str: ...
def __eq__(self, other: object) -> bool: ...
def __ne__(self, __other: object) -> bool: ...
@@ -25,7 +25,7 @@ class Header:
def decode_header(header: Header | str) -> list[tuple[Any, Any | None]]: ...
def make_header(
decoded_seq: Iterable[tuple[bytes | bytearray | str, str | None]],
maxlinelen: int | None = ...,
header_name: str | None = ...,
continuation_ws: str = ...,
maxlinelen: int | None = None,
header_name: str | None = None,
continuation_ws: str = " ",
) -> Header: ...

View File

@@ -153,7 +153,7 @@ class HeaderRegistry:
base_class: type[BaseHeader]
default_class: type[_HeaderParser]
def __init__(
self, base_class: type[BaseHeader] = ..., default_class: type[_HeaderParser] = ..., use_default_map: bool = ...
self, base_class: type[BaseHeader] = ..., default_class: type[_HeaderParser] = ..., use_default_map: bool = True
) -> None: ...
def map_to_type(self, name: str, cls: type[BaseHeader]) -> None: ...
def __getitem__(self, name: str) -> type[BaseHeader]: ...
@@ -169,7 +169,7 @@ class Address:
@property
def addr_spec(self) -> str: ...
def __init__(
self, display_name: str = ..., username: str | None = ..., domain: str | None = ..., addr_spec: str | None = ...
self, display_name: str = "", username: str | None = "", domain: str | None = "", addr_spec: str | None = None
) -> None: ...
def __eq__(self, other: object) -> bool: ...
@@ -178,5 +178,5 @@ class Group:
def display_name(self) -> str | None: ...
@property
def addresses(self) -> tuple[Address, ...]: ...
def __init__(self, display_name: str | None = ..., addresses: Iterable[Address] | None = ...) -> None: ...
def __init__(self, display_name: str | None = None, addresses: Iterable[Address] | None = None) -> None: ...
def __eq__(self, other: object) -> bool: ...

View File

@@ -4,9 +4,9 @@ from email.message import Message
__all__ = ["body_line_iterator", "typed_subpart_iterator", "walk"]
def body_line_iterator(msg: Message, decode: bool = ...) -> Iterator[str]: ...
def typed_subpart_iterator(msg: Message, maintype: str = ..., subtype: str | None = ...) -> Iterator[str]: ...
def body_line_iterator(msg: Message, decode: bool = False) -> Iterator[str]: ...
def typed_subpart_iterator(msg: Message, maintype: str = "text", subtype: str | None = None) -> Iterator[str]: ...
def walk(self: Message) -> Iterator[Message]: ...
# We include the seemingly private function because it is documented in the stdlib documentation.
def _structure(msg: Message, fp: SupportsWrite[str] | None = ..., level: int = ..., include_default: bool = ...) -> None: ...
def _structure(msg: Message, fp: SupportsWrite[str] | None = None, level: int = 0, include_default: bool = False) -> None: ...

View File

@@ -25,8 +25,8 @@ class Message:
def set_unixfrom(self, unixfrom: str) -> None: ...
def get_unixfrom(self) -> str | None: ...
def attach(self, payload: Message) -> None: ...
def get_payload(self, i: int | None = ..., decode: bool = ...) -> Any: ... # returns _PayloadType | None
def set_payload(self, payload: _PayloadType, charset: _CharsetType = ...) -> None: ...
def get_payload(self, i: int | None = None, decode: bool = False) -> Any: ... # returns _PayloadType | None
def set_payload(self, payload: _PayloadType, charset: _CharsetType = None) -> None: ...
def set_charset(self, charset: _CharsetType) -> None: ...
def get_charset(self) -> _CharsetType: ...
def __len__(self) -> int: ...
@@ -47,10 +47,10 @@ class Message:
def get_content_subtype(self) -> str: ...
def get_default_type(self) -> str: ...
def set_default_type(self, ctype: str) -> None: ...
def get_params(self, failobj: _T = ..., header: str = ..., unquote: bool = ...) -> list[tuple[str, str]] | _T: ...
def get_param(self, param: str, failobj: _T = ..., header: str = ..., unquote: bool = ...) -> _T | _ParamType: ...
def del_param(self, param: str, header: str = ..., requote: bool = ...) -> None: ...
def set_type(self, type: str, header: str = ..., requote: bool = ...) -> None: ...
def get_params(self, failobj: _T = ..., header: str = "content-type", unquote: bool = True) -> list[tuple[str, str]] | _T: ...
def get_param(self, param: str, failobj: _T = ..., header: str = "content-type", unquote: bool = True) -> _T | _ParamType: ...
def del_param(self, param: str, header: str = "content-type", requote: bool = True) -> None: ...
def set_type(self, type: str, header: str = "Content-Type", requote: bool = True) -> None: ...
def get_filename(self, failobj: _T = ...) -> _T | str: ...
def get_boundary(self, failobj: _T = ...) -> _T | str: ...
def set_boundary(self, boundary: str) -> None: ...
@@ -61,18 +61,18 @@ class Message:
def get_charsets(self, failobj: _T = ...) -> _T | list[str]: ...
def walk(self: Self) -> Generator[Self, None, None]: ...
def get_content_disposition(self) -> str | None: ...
def as_string(self, unixfrom: bool = ..., maxheaderlen: int = ..., policy: Policy | None = ...) -> str: ...
def as_bytes(self, unixfrom: bool = ..., policy: Policy | None = ...) -> bytes: ...
def as_string(self, unixfrom: bool = False, maxheaderlen: int = 0, policy: Policy | None = None) -> str: ...
def as_bytes(self, unixfrom: bool = False, policy: Policy | None = None) -> bytes: ...
def __bytes__(self) -> bytes: ...
def set_param(
self,
param: str,
value: str,
header: str = ...,
requote: bool = ...,
charset: str | None = ...,
language: str = ...,
replace: bool = ...,
header: str = "Content-Type",
requote: bool = True,
charset: str | None = None,
language: str = "",
replace: bool = False,
) -> None: ...
def __init__(self, policy: Policy = ...) -> None: ...
# The following two methods are undocumented, but a source code comment states that they are public API
@@ -80,21 +80,21 @@ class Message:
def raw_items(self) -> Iterator[tuple[str, _HeaderType]]: ...
class MIMEPart(Message):
def __init__(self, policy: Policy | None = ...) -> None: ...
def __init__(self, policy: Policy | None = None) -> None: ...
def get_body(self, preferencelist: Sequence[str] = ...) -> Message | None: ...
def iter_attachments(self) -> Iterator[Message]: ...
def iter_parts(self) -> Iterator[Message]: ...
def get_content(self, *args: Any, content_manager: ContentManager | None = ..., **kw: Any) -> Any: ...
def set_content(self, *args: Any, content_manager: ContentManager | None = ..., **kw: Any) -> None: ...
def make_related(self, boundary: str | None = ...) -> None: ...
def make_alternative(self, boundary: str | None = ...) -> None: ...
def make_mixed(self, boundary: str | None = ...) -> None: ...
def get_content(self, *args: Any, content_manager: ContentManager | None = None, **kw: Any) -> Any: ...
def set_content(self, *args: Any, content_manager: ContentManager | None = None, **kw: Any) -> None: ...
def make_related(self, boundary: str | None = None) -> None: ...
def make_alternative(self, boundary: str | None = None) -> None: ...
def make_mixed(self, boundary: str | None = None) -> None: ...
def add_related(self, *args: Any, content_manager: ContentManager | None = ..., **kw: Any) -> None: ...
def add_alternative(self, *args: Any, content_manager: ContentManager | None = ..., **kw: Any) -> None: ...
def add_attachment(self, *args: Any, content_manager: ContentManager | None = ..., **kw: Any) -> None: ...
def clear(self) -> None: ...
def clear_content(self) -> None: ...
def as_string(self, unixfrom: bool = ..., maxheaderlen: int | None = ..., policy: Policy | None = ...) -> str: ...
def as_string(self, unixfrom: bool = False, maxheaderlen: int | None = None, policy: Policy | None = None) -> str: ...
def is_attachment(self) -> bool: ...
class EmailMessage(MIMEPart): ...

View File

@@ -9,9 +9,9 @@ class MIMEApplication(MIMENonMultipart):
def __init__(
self,
_data: str | bytes | bytearray,
_subtype: str = ...,
_subtype: str = "octet-stream",
_encoder: Callable[[MIMEApplication], object] = ...,
*,
policy: Policy | None = ...,
policy: Policy | None = None,
**_params: _ParamsType,
) -> None: ...

View File

@@ -9,9 +9,9 @@ class MIMEAudio(MIMENonMultipart):
def __init__(
self,
_audiodata: str | bytes | bytearray,
_subtype: str | None = ...,
_subtype: str | None = None,
_encoder: Callable[[MIMEAudio], object] = ...,
*,
policy: Policy | None = ...,
policy: Policy | None = None,
**_params: _ParamsType,
) -> None: ...

View File

@@ -5,4 +5,4 @@ from email.policy import Policy
__all__ = ["MIMEBase"]
class MIMEBase(email.message.Message):
def __init__(self, _maintype: str, _subtype: str, *, policy: Policy | None = ..., **_params: _ParamsType) -> None: ...
def __init__(self, _maintype: str, _subtype: str, *, policy: Policy | None = None, **_params: _ParamsType) -> None: ...

View File

@@ -9,9 +9,9 @@ class MIMEImage(MIMENonMultipart):
def __init__(
self,
_imagedata: str | bytes | bytearray,
_subtype: str | None = ...,
_subtype: str | None = None,
_encoder: Callable[[MIMEImage], object] = ...,
*,
policy: Policy | None = ...,
policy: Policy | None = None,
**_params: _ParamsType,
) -> None: ...

View File

@@ -5,4 +5,4 @@ from email.policy import Policy
__all__ = ["MIMEMessage"]
class MIMEMessage(MIMENonMultipart):
def __init__(self, _msg: Message, _subtype: str = ..., *, policy: Policy | None = ...) -> None: ...
def __init__(self, _msg: Message, _subtype: str = "rfc822", *, policy: Policy | None = None) -> None: ...

View File

@@ -9,10 +9,10 @@ __all__ = ["MIMEMultipart"]
class MIMEMultipart(MIMEBase):
def __init__(
self,
_subtype: str = ...,
boundary: str | None = ...,
_subparts: Sequence[Message] | None = ...,
_subtype: str = "mixed",
boundary: str | None = None,
_subparts: Sequence[Message] | None = None,
*,
policy: Policy | None = ...,
policy: Policy | None = None,
**_params: _ParamsType,
) -> None: ...

View File

@@ -4,4 +4,6 @@ from email.policy import Policy
__all__ = ["MIMEText"]
class MIMEText(MIMENonMultipart):
def __init__(self, _text: str, _subtype: str = ..., _charset: str | None = ..., *, policy: Policy | None = ...) -> None: ...
def __init__(
self, _text: str, _subtype: str = "plain", _charset: str | None = None, *, policy: Policy | None = None
) -> None: ...

View File

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

View File

@@ -19,9 +19,9 @@ def header_length(bytearray: Iterable[int]) -> int: ...
def body_length(bytearray: Iterable[int]) -> int: ...
def unquote(s: str | bytes | bytearray) -> str: ...
def quote(c: str | bytes | bytearray) -> str: ...
def header_encode(header_bytes: bytes | bytearray, charset: str = ...) -> str: ...
def body_encode(body: str, maxlinelen: int = ..., eol: str = ...) -> str: ...
def decode(encoded: str, eol: str = ...) -> str: ...
def header_encode(header_bytes: bytes | bytearray, charset: str = "iso-8859-1") -> str: ...
def body_encode(body: str, maxlinelen: int = 76, eol: str = "\n") -> str: ...
def decode(encoded: str, eol: str = "\n") -> str: ...
def header_decode(s: str) -> str: ...
body_decode = decode

View File

@@ -28,7 +28,7 @@ _PDTZ: TypeAlias = tuple[int, int, int, int, int, int, int, int, int, int | None
def quote(str: str) -> str: ...
def unquote(str: str) -> str: ...
def parseaddr(addr: str | None) -> tuple[str, str]: ...
def formataddr(pair: tuple[str | None, str], charset: str | Charset = ...) -> str: ...
def formataddr(pair: tuple[str | None, str], charset: str | Charset = "utf-8") -> str: ...
def getaddresses(fieldvalues: list[str]) -> list[tuple[str, str]]: ...
@overload
def parsedate(data: None) -> None: ...
@@ -49,11 +49,11 @@ else:
def parsedate_to_datetime(data: str) -> datetime.datetime: ...
def mktime_tz(data: _PDTZ) -> int: ...
def formatdate(timeval: float | None = ..., localtime: bool = ..., usegmt: bool = ...) -> str: ...
def format_datetime(dt: datetime.datetime, usegmt: bool = ...) -> str: ...
def localtime(dt: datetime.datetime | None = ..., isdst: int = ...) -> datetime.datetime: ...
def make_msgid(idstring: str | None = ..., domain: str | None = ...) -> str: ...
def formatdate(timeval: float | None = None, localtime: bool = False, usegmt: bool = False) -> str: ...
def format_datetime(dt: datetime.datetime, usegmt: bool = False) -> str: ...
def localtime(dt: datetime.datetime | None = None, isdst: int = -1) -> datetime.datetime: ...
def make_msgid(idstring: str | None = None, domain: str | None = None) -> str: ...
def decode_rfc2231(s: str) -> tuple[str | None, str | None, str]: ...
def encode_rfc2231(s: str, charset: str | None = ..., language: str | None = ...) -> str: ...
def collapse_rfc2231_value(value: _ParamType, errors: str = ..., fallback_charset: str = ...) -> str: ...
def encode_rfc2231(s: str, charset: str | None = None, language: str | None = None) -> str: ...
def collapse_rfc2231_value(value: _ParamType, errors: str = "replace", fallback_charset: str = "us-ascii") -> str: ...
def decode_params(params: list[tuple[str, str]]) -> list[tuple[str, _ParamType]]: ...

Some files were not shown because too many files have changed in this diff Show More