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
6 changes: 3 additions & 3 deletions stdlib/_interpchannels.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from _typeshed import structseq
from _typeshed import FloatInt, structseq
from typing import Any, Final, Literal, SupportsIndex, final
from typing_extensions import Buffer, Self

Expand Down Expand Up @@ -76,8 +76,8 @@ def create(unboundop: Literal[1, 2, 3]) -> ChannelID: ...
def destroy(cid: SupportsIndex) -> None: ...
def list_all() -> list[ChannelID]: ...
def list_interpreters(cid: SupportsIndex, *, send: bool) -> list[int]: ...
def send(cid: SupportsIndex, obj: object, *, blocking: bool = True, timeout: float | None = None) -> None: ...
def send_buffer(cid: SupportsIndex, obj: Buffer, *, blocking: bool = True, timeout: float | None = None) -> None: ...
def send(cid: SupportsIndex, obj: object, *, blocking: bool = True, timeout: FloatInt | None = None) -> None: ...
def send_buffer(cid: SupportsIndex, obj: Buffer, *, blocking: bool = True, timeout: FloatInt | None = None) -> None: ...
def recv(cid: SupportsIndex, default: object = ...) -> tuple[Any, Literal[1, 2, 3]]: ...
def close(cid: SupportsIndex, *, send: bool = False, recv: bool = False) -> None: ...
def get_count(cid: SupportsIndex) -> int: ...
Expand Down
12 changes: 6 additions & 6 deletions stdlib/_lsprof.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from _typeshed import structseq
from _typeshed import FloatInt, structseq
from collections.abc import Callable
from types import CodeType
from typing import Any, Final, final
Expand All @@ -7,7 +7,7 @@ from typing_extensions import disjoint_base
@disjoint_base
class Profiler:
def __init__(
self, timer: Callable[[], float] | None = None, timeunit: float = 0.0, subcalls: bool = True, builtins: bool = True
self, timer: Callable[[], float] | None = None, timeunit: FloatInt = 0.0, subcalls: bool = True, builtins: bool = True
) -> None: ...
def getstats(self) -> list[profiler_entry]: ...
def enable(self, subcalls: bool = True, builtins: bool = True) -> None: ...
Expand All @@ -20,8 +20,8 @@ class profiler_entry(structseq[Any], tuple[CodeType | str, int, int, float, floa
code: CodeType | str
callcount: int
reccallcount: int
totaltime: float
inlinetime: float
totaltime: FloatInt
inlinetime: FloatInt
calls: list[profiler_subentry]

@final
Expand All @@ -30,5 +30,5 @@ class profiler_subentry(structseq[Any], tuple[CodeType | str, int, int, float, f
code: CodeType | str
callcount: int
reccallcount: int
totaltime: float
inlinetime: float
totaltime: FloatInt
inlinetime: FloatInt
5 changes: 3 additions & 2 deletions stdlib/_queue.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from _typeshed import FloatInt
from types import GenericAlias
from typing import Any, Generic, TypeVar
from typing_extensions import disjoint_base
Expand All @@ -10,9 +11,9 @@ class Empty(Exception): ...
class SimpleQueue(Generic[_T]):
def __init__(self) -> None: ...
def empty(self) -> bool: ...
def get(self, block: bool = True, timeout: float | None = None) -> _T: ...
def get(self, block: bool = True, timeout: FloatInt | None = None) -> _T: ...
def get_nowait(self) -> _T: ...
def put(self, item: _T, block: bool = True, timeout: float | None = None) -> None: ...
def put(self, item: _T, block: bool = True, timeout: FloatInt | None = None) -> None: ...
def put_nowait(self, item: _T) -> None: ...
def qsize(self) -> int: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
11 changes: 8 additions & 3 deletions stdlib/_remote_debugging.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from _typeshed import StrOrBytesPath, structseq
from _typeshed import FloatInt, StrOrBytesPath, structseq
from collections.abc import Callable
from typing import Final, TypeAlias, final
from typing_extensions import Self

_Location: TypeAlias = tuple[int, int, int, int] | LocationInfo | None
_Frame: TypeAlias = tuple[str, _Location, str, int | None] | FrameInfo
_Stats: TypeAlias = dict[str, int | float]
_Stats: TypeAlias = dict[str, float | int]

PROCESS_VM_READV_SUPPORTED: Final[int]
THREAD_STATUS_GIL_REQUESTED: Final[int]
Expand Down Expand Up @@ -161,7 +161,12 @@ class BinaryWriter:
def limit_reached(self) -> bool: ...
def write_sample(self, stack_frames: list[InterpreterInfo], timestamp_us: int) -> None: ...
def set_stats(
self, /, duration_sec: float, sample_rate: float, error_rate: float | None = None, missed_samples: float | None = None
self,
/,
duration_sec: FloatInt,
sample_rate: FloatInt,
error_rate: FloatInt | None = None,
missed_samples: FloatInt | None = None,
) -> None: ...
def finalize(self) -> None: ...
def close(self) -> None: ...
Expand Down
6 changes: 3 additions & 3 deletions stdlib/_socket.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sys
from _typeshed import ReadableBuffer, WriteableBuffer
from _typeshed import FloatInt, ReadableBuffer, WriteableBuffer
from collections.abc import Iterable
from socket import error as error, gaierror as gaierror, herror as herror, timeout as timeout
from typing import Any, Final, SupportsIndex, TypeAlias, overload
Expand Down Expand Up @@ -906,7 +906,7 @@ class socket:
) -> int: ...

def setblocking(self, flag: bool, /) -> None: ...
def settimeout(self, value: float | None, /) -> None: ...
def settimeout(self, value: FloatInt | None, /) -> None: ...

@overload
def setsockopt(self, level: int, optname: int, value: int | ReadableBuffer, /) -> None: ...
Expand Down Expand Up @@ -948,7 +948,7 @@ def inet_ntop(address_family: int, packed_ip: ReadableBuffer, /) -> str: ...
def getdefaulttimeout() -> float | None: ...

# F811: "Redefinition of unused `timeout`"
def setdefaulttimeout(timeout: float | None, /) -> None: ...
def setdefaulttimeout(timeout: FloatInt | None, /) -> None: ...

if sys.platform != "win32":
def sethostname(name: str, /) -> None: ...
Expand Down
16 changes: 8 additions & 8 deletions stdlib/_sqlite3.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sys
from _typeshed import ReadableBuffer, StrOrBytesPath
from _typeshed import FloatInt, ReadableBuffer, StrOrBytesPath
from collections.abc import Callable
from sqlite3 import (
Connection as Connection,
Expand All @@ -26,7 +26,7 @@ if sys.version_info >= (3, 11):

_T = TypeVar("_T")
_ConnectionT = TypeVar("_ConnectionT", bound=Connection)
_SqliteData: TypeAlias = str | ReadableBuffer | int | float | None
_SqliteData: TypeAlias = str | ReadableBuffer | float | int | None
_Adapter: TypeAlias = Callable[[_T], _SqliteData]
_Converter: TypeAlias = Callable[[bytes], Any]

Expand Down Expand Up @@ -227,7 +227,7 @@ if sys.version_info >= (3, 12):
@overload
def connect(
database: StrOrBytesPath,
timeout: float = 5.0,
timeout: FloatInt = 5.0,
detect_types: int = 0,
isolation_level: _IsolationLevel = "DEFERRED",
check_same_thread: bool = True,
Expand All @@ -239,7 +239,7 @@ if sys.version_info >= (3, 12):
@overload
def connect(
database: StrOrBytesPath,
timeout: float,
timeout: FloatInt,
detect_types: int,
isolation_level: _IsolationLevel,
check_same_thread: bool,
Expand All @@ -252,7 +252,7 @@ if sys.version_info >= (3, 12):
@overload
def connect(
database: StrOrBytesPath,
timeout: float = 5.0,
timeout: FloatInt = 5.0,
detect_types: int = 0,
isolation_level: _IsolationLevel = "DEFERRED",
check_same_thread: bool = True,
Expand All @@ -266,7 +266,7 @@ else:
@overload
def connect(
database: StrOrBytesPath,
timeout: float = 5.0,
timeout: FloatInt = 5.0,
detect_types: int = 0,
isolation_level: _IsolationLevel = "DEFERRED",
check_same_thread: bool = True,
Expand All @@ -276,7 +276,7 @@ else:
@overload
def connect(
database: StrOrBytesPath,
timeout: float,
timeout: FloatInt,
detect_types: int,
isolation_level: _IsolationLevel,
check_same_thread: bool,
Expand All @@ -287,7 +287,7 @@ else:
@overload
def connect(
database: StrOrBytesPath,
timeout: float = 5.0,
timeout: FloatInt = 5.0,
detect_types: int = 0,
isolation_level: _IsolationLevel = "DEFERRED",
check_same_thread: bool = True,
Expand Down
4 changes: 2 additions & 2 deletions stdlib/_ssl.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sys
from _typeshed import ReadableBuffer, StrOrBytesPath
from _typeshed import FloatInt, ReadableBuffer, StrOrBytesPath
from collections.abc import Callable
from ssl import (
SSLCertVerificationError as SSLCertVerificationError,
Expand Down Expand Up @@ -47,7 +47,7 @@ class _CertInfo(TypedDict):
caIssuers: NotRequired[tuple[str, ...] | None]
crlDistributionPoints: NotRequired[tuple[str, ...] | None]

def RAND_add(string: str | ReadableBuffer, entropy: float, /) -> None: ...
def RAND_add(string: str | ReadableBuffer, entropy: FloatInt, /) -> None: ...
def RAND_bytes(n: int, /) -> bytes: ...

if sys.version_info < (3, 12):
Expand Down
16 changes: 8 additions & 8 deletions stdlib/_thread.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import signal
import sys
from _typeshed import structseq
from _typeshed import FloatInt, structseq
from collections.abc import Callable
from threading import Thread
from types import TracebackType
Expand All @@ -15,7 +15,7 @@ def _count() -> int: ...

@final
class RLock:
def acquire(self, blocking: bool = True, timeout: float = -1) -> bool: ...
def acquire(self, blocking: bool = True, timeout: FloatInt = -1) -> bool: ...
def release(self) -> None: ...
__enter__ = acquire
def __exit__(
Expand All @@ -29,7 +29,7 @@ if sys.version_info >= (3, 13):
class _ThreadHandle:
ident: int

def join(self, timeout: float | None = None, /) -> None: ...
def join(self, timeout: FloatInt | None = None, /) -> None: ...
def is_done(self) -> bool: ...
def _set_done(self) -> None: ...

Expand All @@ -39,11 +39,11 @@ if sys.version_info >= (3, 13):

@final
class lock:
def acquire(self, blocking: bool = True, timeout: float = -1) -> bool: ...
def acquire(self, blocking: bool = True, timeout: FloatInt = -1) -> bool: ...
def release(self) -> None: ...
def locked(self) -> bool: ...
@deprecated("Obsolete synonym. Use `acquire()` instead.")
def acquire_lock(self, blocking: bool = True, timeout: float = -1) -> bool: ... # undocumented
def acquire_lock(self, blocking: bool = True, timeout: FloatInt = -1) -> bool: ... # undocumented
@deprecated("Obsolete synonym. Use `release()` instead.")
def release_lock(self) -> None: ... # undocumented
@deprecated("Obsolete synonym. Use `locked()` instead.")
Expand All @@ -57,11 +57,11 @@ if sys.version_info >= (3, 13):
else:
@final
class LockType:
def acquire(self, blocking: bool = True, timeout: float = -1) -> bool: ...
def acquire(self, blocking: bool = True, timeout: FloatInt = -1) -> bool: ...
def release(self) -> None: ...
def locked(self) -> bool: ...
@deprecated("Obsolete synonym. Use `acquire()` instead.")
def acquire_lock(self, blocking: bool = True, timeout: float = -1) -> bool: ... # undocumented
def acquire_lock(self, blocking: bool = True, timeout: FloatInt = -1) -> bool: ... # undocumented
@deprecated("Obsolete synonym. Use `release()` instead.")
def release_lock(self) -> None: ... # undocumented
@deprecated("Obsolete synonym. Use `locked()` instead.")
Expand Down Expand Up @@ -93,7 +93,7 @@ def allocate() -> LockType: ... # undocumented
def get_ident() -> int: ...
def stack_size(size: int = 0, /) -> int: ...

TIMEOUT_MAX: Final[float]
TIMEOUT_MAX: Final[FloatInt]

def get_native_id() -> int: ... # only available on some platforms

Expand Down
2 changes: 1 addition & 1 deletion stdlib/_typeshed/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Unused: TypeAlias = object # stable
# for more information.
MaybeNone: TypeAlias = Any # stable

# typeshed-internal type aliases to facilitate transition from
# typeshed-internal type alias to facilitate transition from
# `float` to either `float | int` or `float`. When you encounter this type
# alias, you are encouraged to replace it with the correct type. Please don't
# use it outside typeshed.
Expand Down
4 changes: 2 additions & 2 deletions stdlib/antigravity.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from _typeshed import ReadableBuffer
from _typeshed import FloatInt, ReadableBuffer

def geohash(latitude: float, longitude: float, datedow: ReadableBuffer) -> None: ...
def geohash(latitude: FloatInt, longitude: FloatInt, datedow: ReadableBuffer) -> None: ...
6 changes: 3 additions & 3 deletions stdlib/array.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sys
from _typeshed import ReadableBuffer, SupportsRead, SupportsWrite
from _typeshed import FloatInt, ReadableBuffer, SupportsRead, SupportsWrite
from collections.abc import Iterable, MutableSequence
from types import GenericAlias
from typing import Any, ClassVar, Literal, SupportsIndex, TypeAlias, TypeVar, overload
Expand All @@ -16,7 +16,7 @@ else:
_UnicodeTypeCode: TypeAlias = Literal["u"]
_TypeCode: TypeAlias = _IntTypeCode | _FloatTypeCode | _UnicodeTypeCode

_T = TypeVar("_T", int, float, str)
_T = TypeVar("_T", float, int, str)

if sys.version_info >= (3, 15):
typecodes: tuple[str, ...]
Expand All @@ -36,7 +36,7 @@ class array(MutableSequence[_T]):
) -> array[int]: ...
@overload
def __new__(
cls: type[array[float]], typecode: _FloatTypeCode, initializer: bytes | bytearray | Iterable[float] = ..., /
cls: type[array[float]], typecode: _FloatTypeCode, initializer: bytes | bytearray | Iterable[FloatInt] = ..., /
) -> array[float]: ...
if sys.version_info >= (3, 13):
@overload
Expand Down
2 changes: 1 addition & 1 deletion stdlib/ast.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ if sys.version_info >= (3, 14):
**kwargs: Unpack[_Attributes],
) -> Self: ...

_ConstantValue: typing_extensions.TypeAlias = str | bytes | bool | int | float | complex | EllipsisType | None
_ConstantValue: typing_extensions.TypeAlias = str | bytes | bool | complex | float | int | EllipsisType | None

class Constant(expr):
__match_args__ = ("value", "kind")
Expand Down
Loading
Loading