Skip to content

stdlib: add defaults #9501

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions stdlib/_compression.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
2 changes: 1 addition & 1 deletion stdlib/_curses.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down
76 changes: 38 additions & 38 deletions stdlib/_decimal.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ...,
Expand All @@ -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]: ...
Expand All @@ -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: ...
Expand All @@ -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: ...
Expand Down Expand Up @@ -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: ...
Expand Down
2 changes: 1 addition & 1 deletion stdlib/_imp.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions stdlib/_markupbase.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions stdlib/_osx_support.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion stdlib/_sitebuiltins.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down
2 changes: 1 addition & 1 deletion stdlib/abc.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down
Loading