Skip to content

Commit ddfaca3

Browse files
stdlib: add argument default values (#9501)
1 parent 6cb9342 commit ddfaca3

File tree

272 files changed

+2528
-2466
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

272 files changed

+2528
-2466
lines changed

stdlib/_compression.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ class DecompressReader(RawIOBase):
2121
**decomp_args: Any,
2222
) -> None: ...
2323
def readinto(self, b: WriteableBuffer) -> int: ...
24-
def read(self, size: int = ...) -> bytes: ...
25-
def seek(self, offset: int, whence: int = ...) -> int: ...
24+
def read(self, size: int = -1) -> bytes: ...
25+
def seek(self, offset: int, whence: int = 0) -> int: ...

stdlib/_curses.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ if sys.platform != "win32":
345345
def set_tabsize(__size: int) -> None: ...
346346

347347
def setsyx(__y: int, __x: int) -> None: ...
348-
def setupterm(term: str | None = ..., fd: int = ...) -> None: ...
348+
def setupterm(term: str | None = None, fd: int = -1) -> None: ...
349349
def start_color() -> None: ...
350350
def termattrs() -> int: ...
351351
def termname() -> bytes: ...

stdlib/_decimal.pyi

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def getcontext() -> Context: ...
5353

5454
if sys.version_info >= (3, 11):
5555
def localcontext(
56-
ctx: Context | None = ...,
56+
ctx: Context | None = None,
5757
*,
5858
prec: int | None = ...,
5959
rounding: str | None = ...,
@@ -73,10 +73,10 @@ class Decimal:
7373
@classmethod
7474
def from_float(cls: type[Self], __f: float) -> Self: ...
7575
def __bool__(self) -> bool: ...
76-
def compare(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
76+
def compare(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
7777
def as_tuple(self) -> DecimalTuple: ...
7878
def as_integer_ratio(self) -> tuple[int, int]: ...
79-
def to_eng_string(self, context: Context | None = ...) -> str: ...
79+
def to_eng_string(self, context: Context | None = None) -> str: ...
8080
def __abs__(self) -> Decimal: ...
8181
def __add__(self, __other: _Decimal) -> Decimal: ...
8282
def __divmod__(self, __other: _Decimal) -> tuple[Decimal, Decimal]: ...
@@ -100,7 +100,7 @@ class Decimal:
100100
def __rtruediv__(self, __other: _Decimal) -> Decimal: ...
101101
def __sub__(self, __other: _Decimal) -> Decimal: ...
102102
def __truediv__(self, __other: _Decimal) -> Decimal: ...
103-
def remainder_near(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
103+
def remainder_near(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
104104
def __float__(self) -> float: ...
105105
def __int__(self) -> int: ...
106106
def __trunc__(self) -> int: ...
@@ -116,53 +116,53 @@ class Decimal:
116116
def __round__(self, __ndigits: int) -> Decimal: ...
117117
def __floor__(self) -> int: ...
118118
def __ceil__(self) -> int: ...
119-
def fma(self, other: _Decimal, third: _Decimal, context: Context | None = ...) -> Decimal: ...
119+
def fma(self, other: _Decimal, third: _Decimal, context: Context | None = None) -> Decimal: ...
120120
def __rpow__(self, __other: _Decimal, __context: Context | None = ...) -> Decimal: ...
121-
def normalize(self, context: Context | None = ...) -> Decimal: ...
122-
def quantize(self, exp: _Decimal, rounding: str | None = ..., context: Context | None = ...) -> Decimal: ...
123-
def same_quantum(self, other: _Decimal, context: Context | None = ...) -> bool: ...
124-
def to_integral_exact(self, rounding: str | None = ..., context: Context | None = ...) -> Decimal: ...
125-
def to_integral_value(self, rounding: str | None = ..., context: Context | None = ...) -> Decimal: ...
126-
def to_integral(self, rounding: str | None = ..., context: Context | None = ...) -> Decimal: ...
127-
def sqrt(self, context: Context | None = ...) -> Decimal: ...
128-
def max(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
129-
def min(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
121+
def normalize(self, context: Context | None = None) -> Decimal: ...
122+
def quantize(self, exp: _Decimal, rounding: str | None = None, context: Context | None = None) -> Decimal: ...
123+
def same_quantum(self, other: _Decimal, context: Context | None = None) -> bool: ...
124+
def to_integral_exact(self, rounding: str | None = None, context: Context | None = None) -> Decimal: ...
125+
def to_integral_value(self, rounding: str | None = None, context: Context | None = None) -> Decimal: ...
126+
def to_integral(self, rounding: str | None = None, context: Context | None = None) -> Decimal: ...
127+
def sqrt(self, context: Context | None = None) -> Decimal: ...
128+
def max(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
129+
def min(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
130130
def adjusted(self) -> int: ...
131131
def canonical(self) -> Decimal: ...
132-
def compare_signal(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
133-
def compare_total(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
134-
def compare_total_mag(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
132+
def compare_signal(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
133+
def compare_total(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
134+
def compare_total_mag(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
135135
def copy_abs(self) -> Decimal: ...
136136
def copy_negate(self) -> Decimal: ...
137-
def copy_sign(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
138-
def exp(self, context: Context | None = ...) -> Decimal: ...
137+
def copy_sign(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
138+
def exp(self, context: Context | None = None) -> Decimal: ...
139139
def is_canonical(self) -> bool: ...
140140
def is_finite(self) -> bool: ...
141141
def is_infinite(self) -> bool: ...
142142
def is_nan(self) -> bool: ...
143-
def is_normal(self, context: Context | None = ...) -> bool: ...
143+
def is_normal(self, context: Context | None = None) -> bool: ...
144144
def is_qnan(self) -> bool: ...
145145
def is_signed(self) -> bool: ...
146146
def is_snan(self) -> bool: ...
147-
def is_subnormal(self, context: Context | None = ...) -> bool: ...
147+
def is_subnormal(self, context: Context | None = None) -> bool: ...
148148
def is_zero(self) -> bool: ...
149-
def ln(self, context: Context | None = ...) -> Decimal: ...
150-
def log10(self, context: Context | None = ...) -> Decimal: ...
151-
def logb(self, context: Context | None = ...) -> Decimal: ...
152-
def logical_and(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
153-
def logical_invert(self, context: Context | None = ...) -> Decimal: ...
154-
def logical_or(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
155-
def logical_xor(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
156-
def max_mag(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
157-
def min_mag(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
158-
def next_minus(self, context: Context | None = ...) -> Decimal: ...
159-
def next_plus(self, context: Context | None = ...) -> Decimal: ...
160-
def next_toward(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
161-
def number_class(self, context: Context | None = ...) -> str: ...
149+
def ln(self, context: Context | None = None) -> Decimal: ...
150+
def log10(self, context: Context | None = None) -> Decimal: ...
151+
def logb(self, context: Context | None = None) -> Decimal: ...
152+
def logical_and(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
153+
def logical_invert(self, context: Context | None = None) -> Decimal: ...
154+
def logical_or(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
155+
def logical_xor(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
156+
def max_mag(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
157+
def min_mag(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
158+
def next_minus(self, context: Context | None = None) -> Decimal: ...
159+
def next_plus(self, context: Context | None = None) -> Decimal: ...
160+
def next_toward(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
161+
def number_class(self, context: Context | None = None) -> str: ...
162162
def radix(self) -> Decimal: ...
163-
def rotate(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
164-
def scaleb(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
165-
def shift(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
163+
def rotate(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
164+
def scaleb(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
165+
def shift(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
166166
def __reduce__(self: Self) -> tuple[type[Self], tuple[str]]: ...
167167
def __copy__(self: Self) -> Self: ...
168168
def __deepcopy__(self: Self, __memo: Any) -> Self: ...
@@ -259,7 +259,7 @@ class Context:
259259
def normalize(self, __x: _Decimal) -> Decimal: ...
260260
def number_class(self, __x: _Decimal) -> str: ...
261261
def plus(self, __x: _Decimal) -> Decimal: ...
262-
def power(self, a: _Decimal, b: _Decimal, modulo: _Decimal | None = ...) -> Decimal: ...
262+
def power(self, a: _Decimal, b: _Decimal, modulo: _Decimal | None = None) -> Decimal: ...
263263
def quantize(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
264264
def radix(self) -> Decimal: ...
265265
def remainder(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...

stdlib/_imp.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def lock_held() -> bool: ...
2121
def release_lock() -> None: ...
2222

2323
if sys.version_info >= (3, 11):
24-
def find_frozen(__name: str, *, withdata: bool = ...) -> tuple[memoryview | None, bool, str | None] | None: ...
24+
def find_frozen(__name: str, *, withdata: bool = False) -> tuple[memoryview | None, bool, str | None] | None: ...
2525
def get_frozen_object(__name: str, __data: ReadableBuffer | None = ...) -> types.CodeType: ...
2626

2727
else:

stdlib/_markupbase.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ class ParserBase:
55
def reset(self) -> None: ...
66
def getpos(self) -> tuple[int, int]: ...
77
def unknown_decl(self, data: str) -> None: ...
8-
def parse_comment(self, i: int, report: int = ...) -> int: ... # undocumented
8+
def parse_comment(self, i: int, report: int = 1) -> int: ... # undocumented
99
def parse_declaration(self, i: int) -> int: ... # undocumented
10-
def parse_marked_section(self, i: int, report: int = ...) -> int: ... # undocumented
10+
def parse_marked_section(self, i: int, report: int = 1) -> int: ... # undocumented
1111
def updatepos(self, i: int, j: int) -> int: ... # undocumented
1212
if sys.version_info < (3, 10):
1313
# Removed from ParserBase: https://bugs.python.org/issue31844

stdlib/_osx_support.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ _UNIVERSAL_CONFIG_VARS: tuple[str, ...] # undocumented
1212
_COMPILER_CONFIG_VARS: tuple[str, ...] # undocumented
1313
_INITPRE: str # undocumented
1414

15-
def _find_executable(executable: str, path: str | None = ...) -> str | None: ... # undocumented
15+
def _find_executable(executable: str, path: str | None = None) -> str | None: ... # undocumented
1616

1717
if sys.version_info >= (3, 8):
18-
def _read_output(commandstring: str, capture_stderr: bool = ...) -> str | None: ... # undocumented
18+
def _read_output(commandstring: str, capture_stderr: bool = False) -> str | None: ... # undocumented
1919

2020
else:
2121
def _read_output(commandstring: str) -> str | None: ... # undocumented

stdlib/_sitebuiltins.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class Quitter:
66
name: str
77
eof: str
88
def __init__(self, name: str, eof: str) -> None: ...
9-
def __call__(self, code: int | None = ...) -> NoReturn: ...
9+
def __call__(self, code: int | None = None) -> NoReturn: ...
1010

1111
class _Printer:
1212
MAXLINES: ClassVar[Literal[23]]

stdlib/abc.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class ABCMeta(type):
2020

2121
def __instancecheck__(cls: ABCMeta, instance: Any) -> bool: ...
2222
def __subclasscheck__(cls: ABCMeta, subclass: type) -> bool: ...
23-
def _dump_registry(cls: ABCMeta, file: SupportsWrite[str] | None = ...) -> None: ...
23+
def _dump_registry(cls: ABCMeta, file: SupportsWrite[str] | None = None) -> None: ...
2424
def register(cls: ABCMeta, subclass: type[_T]) -> type[_T]: ...
2525

2626
def abstractmethod(funcobj: _FuncT) -> _FuncT: ...

0 commit comments

Comments
 (0)