Skip to content
Open
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
14 changes: 8 additions & 6 deletions stdlib/faulthandler.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@ from _typeshed import FileDescriptorLike

def cancel_dump_traceback_later() -> None: ...
def disable() -> None: ...
def dump_traceback(file: FileDescriptorLike = ..., all_threads: bool = ...) -> None: ...
def dump_traceback(file: FileDescriptorLike = sys.stderr, all_threads: bool = True) -> None: ...

if sys.version_info >= (3, 14):
def dump_c_stack(file: FileDescriptorLike = ...) -> None: ...
def dump_c_stack(file: FileDescriptorLike = sys.stderr) -> None: ...

def dump_traceback_later(timeout: float, repeat: bool = ..., file: FileDescriptorLike = ..., exit: bool = ...) -> None: ...
def dump_traceback_later(
timeout: float, repeat: bool = False, file: FileDescriptorLike = sys.stderr, exit: bool = False
) -> None: ...

if sys.version_info >= (3, 14):
def enable(file: FileDescriptorLike = ..., all_threads: bool = ..., c_stack: bool = True) -> None: ...
def enable(file: FileDescriptorLike = sys.stderr, all_threads: bool = True, c_stack: bool = True) -> None: ...

else:
def enable(file: FileDescriptorLike = ..., all_threads: bool = ...) -> None: ...
def enable(file: FileDescriptorLike = sys.stderr, all_threads: bool = True) -> None: ...

def is_enabled() -> bool: ...

if sys.platform != "win32":
def register(signum: int, file: FileDescriptorLike = ..., all_threads: bool = ..., chain: bool = ...) -> None: ...
def register(signum: int, file: FileDescriptorLike = sys.stderr, all_threads: bool = True, chain: bool = False) -> None: ...
def unregister(signum: int, /) -> None: ...
2 changes: 1 addition & 1 deletion stdlib/hashlib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ else:
"pbkdf2_hmac",
)

def new(name: str, data: ReadableBuffer = b"", *, usedforsecurity: bool = ...) -> HASH: ...
def new(name: str, data: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...

algorithms_guaranteed: AbstractSet[str]
algorithms_available: AbstractSet[str]
Expand Down
12 changes: 6 additions & 6 deletions stdlib/itertools.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class count(Generic[_N]):
@overload
def __new__(cls) -> count[int]: ...
@overload
def __new__(cls, start: _N, step: _Step = ...) -> count[_N]: ...
def __new__(cls, start: _N, step: _Step = 1) -> count[_N]: ...
@overload
def __new__(cls, *, step: _N) -> count[_N]: ...
def __next__(self) -> _N: ...
Expand All @@ -57,9 +57,9 @@ class repeat(Generic[_T]):
@disjoint_base
class accumulate(Generic[_T]):
@overload
def __new__(cls, iterable: Iterable[_T], func: None = None, *, initial: _T | None = ...) -> Self: ...
def __new__(cls, iterable: Iterable[_T], func: None = None, *, initial: _T | None = None) -> Self: ...
@overload
def __new__(cls, iterable: Iterable[_S], func: Callable[[_T, _S], _T], *, initial: _T | None = ...) -> Self: ...
def __new__(cls, iterable: Iterable[_S], func: Callable[[_T, _S], _T], *, initial: _T | None = None) -> Self: ...
def __iter__(self) -> Self: ...
def __next__(self) -> _T: ...

Expand Down Expand Up @@ -105,7 +105,7 @@ class islice(Generic[_T]):
@overload
def __new__(cls, iterable: Iterable[_T], stop: int | None, /) -> Self: ...
@overload
def __new__(cls, iterable: Iterable[_T], start: int | None, stop: int | None, step: int | None = ..., /) -> Self: ...
def __new__(cls, iterable: Iterable[_T], start: int | None, stop: int | None, step: int | None = 1, /) -> Self: ...
def __iter__(self) -> Self: ...
def __next__(self) -> _T: ...

Expand All @@ -126,7 +126,7 @@ def tee(iterable: Iterable[_T], n: int = 2, /) -> tuple[Iterator[_T], ...]: ...
class zip_longest(Generic[_T_co]):
# one iterable (fillvalue doesn't matter)
@overload
def __new__(cls, iter1: Iterable[_T1], /, *, fillvalue: object = ...) -> zip_longest[tuple[_T1]]: ...
def __new__(cls, iter1: Iterable[_T1], /, *, fillvalue: object = None) -> zip_longest[tuple[_T1]]: ...
# two iterables
@overload
# In the overloads without fillvalue, all of the tuple members could theoretically be None,
Expand Down Expand Up @@ -298,7 +298,7 @@ class permutations(Generic[_T_co]):
@overload
def __new__(cls, iterable: Iterable[_T], r: Literal[5]) -> permutations[tuple[_T, _T, _T, _T, _T]]: ...
@overload
def __new__(cls, iterable: Iterable[_T], r: int | None = ...) -> permutations[tuple[_T, ...]]: ...
def __new__(cls, iterable: Iterable[_T], r: int | None = None) -> permutations[tuple[_T, ...]]: ...
def __iter__(self) -> Self: ...
def __next__(self) -> _T_co: ...

Expand Down
2 changes: 1 addition & 1 deletion stdlib/multiprocessing/reduction.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ HAVE_SEND_HANDLE: Final[bool]

class ForkingPickler(pickle.Pickler):
dispatch_table: _DispatchTableType
def __init__(self, file: SupportsWrite[bytes], protocol: int | None = ...) -> None: ...
def __init__(self, file: SupportsWrite[bytes], protocol: int | None = None) -> None: ...
@classmethod
def register(cls, type: Type, reduce: Callable[[Any], _ReducedType]) -> None: ...
@classmethod
Expand Down
64 changes: 32 additions & 32 deletions stdlib/os/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1020,10 +1020,10 @@ def fdopen(
mode: OpenTextMode = "r",
buffering: int = -1,
encoding: str | None = None,
errors: str | None = ...,
newline: str | None = ...,
closefd: bool = ...,
opener: _Opener | None = ...,
errors: str | None = None,
newline: str | None = None,
closefd: bool = True,
opener: _Opener | None = None,
) -> TextIOWrapper: ...
@overload
def fdopen(
Expand All @@ -1033,8 +1033,8 @@ def fdopen(
encoding: None = None,
errors: None = None,
newline: None = None,
closefd: bool = ...,
opener: _Opener | None = ...,
closefd: bool = True,
opener: _Opener | None = None,
) -> FileIO: ...
@overload
def fdopen(
Expand All @@ -1044,8 +1044,8 @@ def fdopen(
encoding: None = None,
errors: None = None,
newline: None = None,
closefd: bool = ...,
opener: _Opener | None = ...,
closefd: bool = True,
opener: _Opener | None = None,
) -> BufferedRandom: ...
@overload
def fdopen(
Expand All @@ -1055,8 +1055,8 @@ def fdopen(
encoding: None = None,
errors: None = None,
newline: None = None,
closefd: bool = ...,
opener: _Opener | None = ...,
closefd: bool = True,
opener: _Opener | None = None,
) -> BufferedWriter: ...
@overload
def fdopen(
Expand All @@ -1066,8 +1066,8 @@ def fdopen(
encoding: None = None,
errors: None = None,
newline: None = None,
closefd: bool = ...,
opener: _Opener | None = ...,
closefd: bool = True,
opener: _Opener | None = None,
) -> BufferedReader: ...
@overload
def fdopen(
Expand All @@ -1077,19 +1077,19 @@ def fdopen(
encoding: None = None,
errors: None = None,
newline: None = None,
closefd: bool = ...,
opener: _Opener | None = ...,
closefd: bool = True,
opener: _Opener | None = None,
) -> BinaryIO: ...
@overload
def fdopen(
fd: int,
mode: str,
buffering: int = -1,
encoding: str | None = None,
errors: str | None = ...,
newline: str | None = ...,
closefd: bool = ...,
opener: _Opener | None = ...,
errors: str | None = None,
newline: str | None = None,
closefd: bool = True,
opener: _Opener | None = None,
) -> IO[Any]: ...
def close(fd: int) -> None: ...
def closerange(fd_low: int, fd_high: int, /) -> None: ...
Expand Down Expand Up @@ -1478,12 +1478,12 @@ else:
env: _ExecEnv,
/,
*,
file_actions: Sequence[tuple[Any, ...]] | None = ...,
file_actions: Sequence[tuple[Any, ...]] | None = (),
setpgroup: int | None = ...,
resetids: bool = ...,
setsid: bool = ...,
setsigmask: Iterable[int] = ...,
setsigdef: Iterable[int] = ...,
resetids: bool = False,
setsid: bool = False,
setsigmask: Iterable[int] = (),
setsigdef: Iterable[int] = (),
scheduler: tuple[Any, sched_param] | None = ...,
) -> int: ...
def posix_spawnp(
Expand All @@ -1492,12 +1492,12 @@ else:
env: _ExecEnv,
/,
*,
file_actions: Sequence[tuple[Any, ...]] | None = ...,
file_actions: Sequence[tuple[Any, ...]] | None = (),
setpgroup: int | None = ...,
resetids: bool = ...,
setsid: bool = ...,
setsigmask: Iterable[int] = ...,
setsigdef: Iterable[int] = ...,
resetids: bool = False,
setsid: bool = False,
setsigmask: Iterable[int] = (),
setsigdef: Iterable[int] = (),
scheduler: tuple[Any, sched_param] | None = ...,
) -> int: ...
POSIX_SPAWN_OPEN: Final = 0
Expand Down Expand Up @@ -1584,12 +1584,12 @@ if sys.platform == "linux":
MFD_HUGE_2GB: Final[int]
MFD_HUGE_16GB: Final[int]
def memfd_create(name: str, flags: int = ...) -> int: ...
def copy_file_range(src: int, dst: int, count: int, offset_src: int | None = ..., offset_dst: int | None = ...) -> int: ...
def copy_file_range(src: int, dst: int, count: int, offset_src: int | None = None, offset_dst: int | None = None) -> int: ...

def waitstatus_to_exitcode(status: int) -> int: ...

if sys.platform == "linux":
def pidfd_open(pid: int, flags: int = ...) -> int: ...
def pidfd_open(pid: int, flags: int = 0) -> int: ...

if sys.version_info >= (3, 12) and sys.platform == "linux":
PIDFD_NONBLOCK: Final = 2048
Expand All @@ -1613,8 +1613,8 @@ if sys.version_info >= (3, 10) and sys.platform == "linux":
src: FileDescriptor,
dst: FileDescriptor,
count: int,
offset_src: int | None = ...,
offset_dst: int | None = ...,
offset_src: int | None = None,
offset_dst: int | None = None,
flags: int = 0,
) -> int: ...

Expand Down
2 changes: 1 addition & 1 deletion stdlib/pstats.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Stats:
sort_arg_dict_default: _SortArgDict
def __init__(
self,
arg: None | str | Profile | _cProfile = ...,
arg: None | str | Profile | _cProfile = None,
/,
*args: None | str | Profile | _cProfile | Self,
stream: IO[Any] | None = None,
Expand Down
5 changes: 4 additions & 1 deletion stdlib/sched.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys
import time
from collections.abc import Callable
from typing import Any, ClassVar, NamedTuple, type_check_only
from typing_extensions import TypeAlias
Expand Down Expand Up @@ -32,7 +33,9 @@ class scheduler:
timefunc: Callable[[], float]
delayfunc: Callable[[float], object]

def __init__(self, timefunc: Callable[[], float] = ..., delayfunc: Callable[[float], object] = ...) -> None: ...
def __init__(
self, timefunc: Callable[[], float] = time.monotonic, delayfunc: Callable[[float], object] = time.sleep
) -> None: ...
def enterabs(
self, time: float, priority: Any, action: _ActionCallback, argument: tuple[Any, ...] = (), kwargs: dict[str, Any] = ...
) -> Event: ...
Expand Down
14 changes: 4 additions & 10 deletions stdlib/select.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,7 @@ if sys.platform != "linux" and sys.platform != "win32":
ident: int
udata: Any
def __init__(
self,
ident: FileDescriptorLike,
filter: int = ...,
flags: int = ...,
fflags: int = ...,
data: Any = ...,
udata: Any = ...,
self, ident: FileDescriptorLike, filter: int = ..., flags: int = ..., fflags: int = 0, data: Any = 0, udata: Any = 0
) -> None: ...
__hash__: ClassVar[None] # type: ignore[assignment]

Expand Down Expand Up @@ -114,12 +108,12 @@ if sys.platform != "linux" and sys.platform != "win32":
if sys.platform == "linux":
@final
class epoll:
def __new__(self, sizehint: int = ..., flags: int = ...) -> Self: ...
def __new__(self, sizehint: int = -1, flags: int = 0) -> Self: ...
def __enter__(self) -> Self: ...
def __exit__(
self,
exc_type: type[BaseException] | None = None,
exc_value: BaseException | None = ...,
exc_value: BaseException | None = None,
exc_tb: TracebackType | None = None,
/,
) -> None: ...
Expand Down Expand Up @@ -160,4 +154,4 @@ if sys.platform != "linux" and sys.platform != "darwin" and sys.platform != "win
def register(self, fd: FileDescriptorLike, eventmask: int = ...) -> None: ...
def modify(self, fd: FileDescriptorLike, eventmask: int = ...) -> None: ...
def unregister(self, fd: FileDescriptorLike) -> None: ...
def poll(self, timeout: float | None = ...) -> list[tuple[int, int]]: ...
def poll(self, timeout: float | None = None) -> list[tuple[int, int]]: ...
Loading
Loading