Sync vendored typeshed stubs (#11668)

Close and reopen this PR to trigger CI

Co-authored-by: typeshedbot <>
This commit is contained in:
github-actions[bot] 2024-05-31 22:26:20 -06:00 committed by GitHub
parent b80bf22c4d
commit 99834ee93d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
114 changed files with 2231 additions and 607 deletions

View File

@ -1 +1 @@
a9d7e861f7a46ae7acd56569326adef302e10f29
4b6558c12ac43cd40716cd6452fe98a632ae65d7

View File

@ -166,7 +166,7 @@ ipaddress: 3.3-
itertools: 3.0-
json: 3.0-
keyword: 3.0-
lib2to3: 3.0-
lib2to3: 3.0-3.12
linecache: 3.0-
locale: 3.0-
logging: 3.0-

File diff suppressed because it is too large Load Diff

View File

@ -201,7 +201,7 @@ class Array(_CData, Generic[_CT]):
# Sized and _CData prevents using _CDataMeta.
def __len__(self) -> int: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
def addressof(obj: _CData) -> int: ...
def alignment(obj_or_type: _CData | type[_CData]) -> int: ...

View File

@ -783,7 +783,7 @@ def ntohl(x: int, /) -> int: ... # param & ret val are 32-bit ints
def ntohs(x: int, /) -> int: ... # param & ret val are 16-bit ints
def htonl(x: int, /) -> int: ... # param & ret val are 32-bit ints
def htons(x: int, /) -> int: ... # param & ret val are 16-bit ints
def inet_aton(ip_string: str, /) -> bytes: ... # ret val 4 bytes in length
def inet_aton(ip_addr: str, /) -> bytes: ... # ret val 4 bytes in length
def inet_ntoa(packed_ip: ReadableBuffer, /) -> str: ...
def inet_pton(address_family: int, ip_string: str, /) -> bytes: ...
def inet_ntop(address_family: int, packed_ip: ReadableBuffer, /) -> str: ...
@ -797,7 +797,7 @@ if sys.platform != "win32":
def socketpair(family: int = ..., type: int = ..., proto: int = ..., /) -> tuple[socket, socket]: ...
def if_nameindex() -> list[tuple[int, str]]: ...
def if_nametoindex(name: str, /) -> int: ...
def if_nametoindex(oname: str, /) -> int: ...
def if_indextoname(index: int, /) -> str: ...
CAPI: object

View File

@ -64,19 +64,19 @@ UF_NODUMP: Literal[0x00000001]
UF_NOUNLINK: Literal[0x00000010]
UF_OPAQUE: Literal[0x00000008]
def S_IMODE(mode: int) -> int: ...
def S_IFMT(mode: int) -> int: ...
def S_ISBLK(mode: int) -> bool: ...
def S_ISCHR(mode: int) -> bool: ...
def S_ISDIR(mode: int) -> bool: ...
def S_ISDOOR(mode: int) -> bool: ...
def S_ISFIFO(mode: int) -> bool: ...
def S_ISLNK(mode: int) -> bool: ...
def S_ISPORT(mode: int) -> bool: ...
def S_ISREG(mode: int) -> bool: ...
def S_ISSOCK(mode: int) -> bool: ...
def S_ISWHT(mode: int) -> bool: ...
def filemode(mode: int) -> str: ...
def S_IMODE(mode: int, /) -> int: ...
def S_IFMT(mode: int, /) -> int: ...
def S_ISBLK(mode: int, /) -> bool: ...
def S_ISCHR(mode: int, /) -> bool: ...
def S_ISDIR(mode: int, /) -> bool: ...
def S_ISDOOR(mode: int, /) -> bool: ...
def S_ISFIFO(mode: int, /) -> bool: ...
def S_ISLNK(mode: int, /) -> bool: ...
def S_ISPORT(mode: int, /) -> bool: ...
def S_ISREG(mode: int, /) -> bool: ...
def S_ISSOCK(mode: int, /) -> bool: ...
def S_ISWHT(mode: int, /) -> bool: ...
def filemode(mode: int, /) -> str: ...
if sys.platform == "win32":
IO_REPARSE_TAG_SYMLINK: int
@ -101,3 +101,17 @@ if sys.platform == "win32":
FILE_ATTRIBUTE_SYSTEM: Literal[4]
FILE_ATTRIBUTE_TEMPORARY: Literal[256]
FILE_ATTRIBUTE_VIRTUAL: Literal[65536]
if sys.version_info >= (3, 13):
SF_SETTABLE: Literal[0x3FFF0000]
# https://github.com/python/cpython/issues/114081#issuecomment-2119017790
# SF_RESTRICTED: Literal[0x00080000]
SF_FIRMLINK: Literal[0x00800000]
SF_DATALESS: Literal[0x40000000]
SF_SUPPORTED: Literal[0x9F0000]
SF_SYNTHETIC: Literal[0xC0000000]
UF_TRACKED: Literal[0x00000040]
UF_DATAVAULT: Literal[0x00000080]
UF_SETTABLE: Literal[0x0000FFFF]

View File

@ -326,6 +326,8 @@ class structseq(Generic[_T_co]):
# but only has any meaning if you supply it a dict where the keys are strings.
# https://github.com/python/typeshed/pull/6560#discussion_r767149830
def __new__(cls: type[Self], sequence: Iterable[_T_co], dict: dict[str, Any] = ...) -> Self: ...
if sys.version_info >= (3, 13):
def __replace__(self: Self, **kwargs: Any) -> Self: ...
# Superset of typing.AnyStr that also includes LiteralString
AnyOrLiteralStr = TypeVar("AnyOrLiteralStr", str, bytes, LiteralString) # noqa: Y001

View File

@ -27,7 +27,7 @@ class ReferenceType(Generic[_T]):
def __eq__(self, value: object, /) -> bool: ...
def __hash__(self) -> int: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
ref = ReferenceType

View File

@ -48,4 +48,4 @@ class WeakSet(MutableSet[_T]):
def __or__(self, other: Iterable[_S]) -> WeakSet[_S | _T]: ...
def isdisjoint(self, other: Iterable[_T]) -> bool: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

View File

@ -318,19 +318,36 @@ class Action(_AttributeHolder):
required: bool
help: str | None
metavar: str | tuple[str, ...] | None
def __init__(
self,
option_strings: Sequence[str],
dest: str,
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: ...
if sys.version_info >= (3, 13):
def __init__(
self,
option_strings: Sequence[str],
dest: str,
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,
deprecated: bool = False,
) -> None: ...
else:
def __init__(
self,
option_strings: Sequence[str],
dest: str,
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 = None
) -> None: ...
@ -339,29 +356,56 @@ class Action(_AttributeHolder):
if sys.version_info >= (3, 12):
class BooleanOptionalAction(Action):
@overload
def __init__(
self,
option_strings: Sequence[str],
dest: str,
default: bool | None = None,
*,
required: bool = False,
help: str | None = None,
) -> None: ...
@overload
@deprecated("The `type`, `choices`, and `metavar` parameters are ignored and will be removed in Python 3.14.")
def __init__(
self,
option_strings: Sequence[str],
dest: str,
default: _T | bool | None = None,
type: Callable[[str], _T] | FileType | None = sentinel,
choices: Iterable[_T] | None = sentinel,
required: bool = False,
help: str | None = None,
metavar: str | tuple[str, ...] | None = sentinel,
) -> None: ...
if sys.version_info >= (3, 13):
@overload
def __init__(
self,
option_strings: Sequence[str],
dest: str,
default: bool | None = None,
*,
required: bool = False,
help: str | None = None,
deprecated: bool = False,
) -> None: ...
@overload
@deprecated("The `type`, `choices`, and `metavar` parameters are ignored and will be removed in Python 3.14.")
def __init__(
self,
option_strings: Sequence[str],
dest: str,
default: _T | bool | None = None,
type: Callable[[str], _T] | FileType | None = sentinel,
choices: Iterable[_T] | None = sentinel,
required: bool = False,
help: str | None = None,
metavar: str | tuple[str, ...] | None = sentinel,
deprecated: bool = False,
) -> None: ...
else:
@overload
def __init__(
self,
option_strings: Sequence[str],
dest: str,
default: bool | None = None,
*,
required: bool = False,
help: str | None = None,
) -> None: ...
@overload
@deprecated("The `type`, `choices`, and `metavar` parameters are ignored and will be removed in Python 3.14.")
def __init__(
self,
option_strings: Sequence[str],
dest: str,
default: _T | bool | None = None,
type: Callable[[str], _T] | FileType | None = sentinel,
choices: Iterable[_T] | None = sentinel,
required: bool = False,
help: str | None = None,
metavar: str | tuple[str, ...] | None = sentinel,
) -> None: ...
elif sys.version_info >= (3, 9):
class BooleanOptionalAction(Action):
@ -431,7 +475,19 @@ class _StoreAction(Action): ...
# undocumented
class _StoreConstAction(Action):
if sys.version_info >= (3, 11):
if sys.version_info >= (3, 13):
def __init__(
self,
option_strings: Sequence[str],
dest: str,
const: Any | None = None,
default: Any = None,
required: bool = False,
help: str | None = None,
metavar: str | tuple[str, ...] | None = None,
deprecated: bool = False,
) -> None: ...
elif sys.version_info >= (3, 11):
def __init__(
self,
option_strings: Sequence[str],
@ -456,15 +512,37 @@ class _StoreConstAction(Action):
# undocumented
class _StoreTrueAction(_StoreConstAction):
def __init__(
self, option_strings: Sequence[str], dest: str, default: bool = False, required: bool = False, help: str | None = None
) -> None: ...
if sys.version_info >= (3, 13):
def __init__(
self,
option_strings: Sequence[str],
dest: str,
default: bool = False,
required: bool = False,
help: str | None = None,
deprecated: bool = False,
) -> None: ...
else:
def __init__(
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 = True, required: bool = False, help: str | None = None
) -> None: ...
if sys.version_info >= (3, 13):
def __init__(
self,
option_strings: Sequence[str],
dest: str,
default: bool = True,
required: bool = False,
help: str | None = None,
deprecated: bool = False,
) -> None: ...
else:
def __init__(
self, option_strings: Sequence[str], dest: str, default: bool = True, required: bool = False, help: str | None = None
) -> None: ...
# undocumented
class _AppendAction(Action): ...
@ -474,7 +552,19 @@ class _ExtendAction(_AppendAction): ...
# undocumented
class _AppendConstAction(Action):
if sys.version_info >= (3, 11):
if sys.version_info >= (3, 13):
def __init__(
self,
option_strings: Sequence[str],
dest: str,
const: Any | None = None,
default: Any = None,
required: bool = False,
help: str | None = None,
metavar: str | tuple[str, ...] | None = None,
deprecated: bool = False,
) -> None: ...
elif sys.version_info >= (3, 11):
def __init__(
self,
option_strings: Sequence[str],
@ -499,27 +589,72 @@ class _AppendConstAction(Action):
# undocumented
class _CountAction(Action):
def __init__(
self, option_strings: Sequence[str], dest: str, default: Any = None, required: bool = False, help: str | None = None
) -> None: ...
if sys.version_info >= (3, 13):
def __init__(
self,
option_strings: Sequence[str],
dest: str,
default: Any = None,
required: bool = False,
help: str | None = None,
deprecated: bool = False,
) -> None: ...
else:
def __init__(
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 = "==SUPPRESS==", default: str = "==SUPPRESS==", help: str | None = None
) -> None: ...
if sys.version_info >= (3, 13):
def __init__(
self,
option_strings: Sequence[str],
dest: str = "==SUPPRESS==",
default: str = "==SUPPRESS==",
help: str | None = None,
deprecated: bool = False,
) -> None: ...
else:
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 = None,
dest: str = "==SUPPRESS==",
default: str = "==SUPPRESS==",
help: str = "show program's version number and exit",
) -> None: ...
if sys.version_info >= (3, 13):
def __init__(
self,
option_strings: Sequence[str],
version: str | None = None,
dest: str = "==SUPPRESS==",
default: str = "==SUPPRESS==",
help: str | None = None,
deprecated: bool = False,
) -> None: ...
elif sys.version_info >= (3, 11):
def __init__(
self,
option_strings: Sequence[str],
version: str | None = None,
dest: str = "==SUPPRESS==",
default: str = "==SUPPRESS==",
help: str | None = None,
) -> None: ...
else:
def __init__(
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
class _SubParsersAction(Action, Generic[_ArgumentParserT]):
@ -542,7 +677,30 @@ class _SubParsersAction(Action, Generic[_ArgumentParserT]):
# Note: `add_parser` accepts all kwargs of `ArgumentParser.__init__`. It also
# accepts its own `help` and `aliases` kwargs.
if sys.version_info >= (3, 9):
if sys.version_info >= (3, 13):
def add_parser(
self,
name: str,
*,
deprecated: bool = False,
help: str | None = ...,
aliases: Sequence[str] = ...,
# Kwargs from ArgumentParser constructor
prog: str | None = ...,
usage: str | None = ...,
description: str | None = ...,
epilog: str | None = ...,
parents: Sequence[_ArgumentParserT] = ...,
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 = ...,
) -> _ArgumentParserT: ...
elif sys.version_info >= (3, 9):
def add_parser(
self,
name: str,

View File

@ -87,6 +87,6 @@ class array(MutableSequence[_T]):
def __buffer__(self, flags: int, /) -> memoryview: ...
def __release_buffer__(self, buffer: memoryview, /) -> None: ...
if sys.version_info >= (3, 12):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
ArrayType = array

View File

@ -30,12 +30,12 @@ if sys.platform == "win32":
else:
from .unix_events import *
_T = TypeVar("_T")
_T_co = TypeVar("_T_co", covariant=True)
# Aliases imported by multiple submodules in typeshed
if sys.version_info >= (3, 12):
_AwaitableLike: TypeAlias = Awaitable[_T] # noqa: Y047
_CoroutineLike: TypeAlias = Coroutine[Any, Any, _T] # noqa: Y047
_AwaitableLike: TypeAlias = Awaitable[_T_co] # noqa: Y047
_CoroutineLike: TypeAlias = Coroutine[Any, Any, _T_co] # noqa: Y047
else:
_AwaitableLike: TypeAlias = Generator[Any, None, _T] | Awaitable[_T]
_CoroutineLike: TypeAlias = Generator[Any, None, _T] | Coroutine[Any, Any, _T]
_AwaitableLike: TypeAlias = Generator[Any, None, _T_co] | Awaitable[_T_co]
_CoroutineLike: TypeAlias = Generator[Any, None, _T_co] | Coroutine[Any, Any, _T_co]

View File

@ -2,7 +2,7 @@ import ssl
import sys
from _typeshed import FileDescriptorLike, ReadableBuffer, StrPath, Unused, WriteableBuffer
from abc import ABCMeta, abstractmethod
from collections.abc import Callable, Coroutine, Generator, Sequence
from collections.abc import Callable, Sequence
from contextvars import Context
from socket import AddressFamily, SocketKind, _Address, _RetAddress, socket
from typing import IO, Any, Literal, Protocol, TypeVar, overload
@ -43,7 +43,7 @@ _ProtocolFactory: TypeAlias = Callable[[], BaseProtocol]
_SSLContext: TypeAlias = bool | None | ssl.SSLContext
class _TaskFactory(Protocol):
def __call__(self, loop: AbstractEventLoop, factory: Coroutine[Any, Any, _T] | Generator[Any, None, _T], /) -> Future[_T]: ...
def __call__(self, loop: AbstractEventLoop, factory: _CoroutineLike[_T], /) -> Future[_T]: ...
class Handle:
_cancelled: bool

View File

@ -52,6 +52,6 @@ class Future(Awaitable[_T], Iterable[_T]):
@property
def _loop(self) -> AbstractEventLoop: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
def wrap_future(future: _ConcurrentFuture[_T] | Future[_T], *, loop: AbstractEventLoop | None = None) -> Future[_T]: ...

View File

@ -41,7 +41,7 @@ class Queue(Generic[_T], _LoopBoundMixin): # noqa: Y059
async def join(self) -> None: ...
def task_done(self) -> None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, type: Any) -> GenericAlias: ...
def __class_getitem__(cls, type: Any, /) -> GenericAlias: ...
class PriorityQueue(Queue[_T]): ...
class LifoQueue(Queue[_T]): ...

View File

@ -443,7 +443,7 @@ class Task(Future[_T_co]): # type: ignore[type-var] # pyright: ignore[reportIn
@classmethod
def all_tasks(cls, loop: AbstractEventLoop | None = None) -> set[Task[Any]]: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
def all_tasks(loop: AbstractEventLoop | None = None) -> set[Task[Any]]: ...

View File

@ -8,5 +8,5 @@ _P = ParamSpec("_P")
def _clear() -> None: ...
def _ncallbacks() -> int: ...
def _run_exitfuncs() -> None: ...
def register(func: Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs) -> Callable[_P, _T]: ...
def unregister(func: Callable[..., object]) -> None: ...
def register(func: Callable[_P, _T], /, *args: _P.args, **kwargs: _P.kwargs) -> Callable[_P, _T]: ...
def unregister(func: Callable[..., object], /) -> None: ...

View File

@ -25,6 +25,8 @@ __all__ = [
if sys.version_info >= (3, 10):
__all__ += ["b32hexencode", "b32hexdecode"]
if sys.version_info >= (3, 13):
__all__ += ["z85decode", "z85encode"]
def b64encode(s: ReadableBuffer, altchars: ReadableBuffer | None = None) -> bytes: ...
def b64decode(s: str | ReadableBuffer, altchars: str | ReadableBuffer | None = None, validate: bool = False) -> bytes: ...
@ -57,3 +59,7 @@ def decodebytes(s: ReadableBuffer) -> bytes: ...
if sys.version_info < (3, 9):
def encodestring(s: ReadableBuffer) -> bytes: ...
def decodestring(s: ReadableBuffer) -> bytes: ...
if sys.version_info >= (3, 13):
def z85encode(s: ReadableBuffer) -> bytes: ...
def z85decode(s: str | ReadableBuffer) -> bytes: ...

View File

@ -461,7 +461,7 @@ class str(Sequence[str]):
def format(self: LiteralString, *args: LiteralString, **kwargs: LiteralString) -> LiteralString: ...
@overload
def format(self, *args: object, **kwargs: object) -> str: ...
def format_map(self, map: _FormatMapMapping) -> str: ...
def format_map(self, mapping: _FormatMapMapping, /) -> str: ...
def index(self, sub: str, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., /) -> int: ...
def isalnum(self) -> bool: ...
def isalpha(self) -> bool: ...
@ -495,10 +495,20 @@ class str(Sequence[str]):
def partition(self: LiteralString, sep: LiteralString, /) -> tuple[LiteralString, LiteralString, LiteralString]: ...
@overload
def partition(self, sep: str, /) -> tuple[str, str, str]: ... # type: ignore[misc]
@overload
def replace(self: LiteralString, old: LiteralString, new: LiteralString, count: SupportsIndex = -1, /) -> LiteralString: ...
@overload
def replace(self, old: str, new: str, count: SupportsIndex = -1, /) -> str: ... # type: ignore[misc]
if sys.version_info >= (3, 13):
@overload
def replace(
self: LiteralString, old: LiteralString, new: LiteralString, /, count: SupportsIndex = -1
) -> LiteralString: ...
@overload
def replace(self, old: str, new: str, /, count: SupportsIndex = -1) -> str: ... # type: ignore[misc]
else:
@overload
def replace(
self: LiteralString, old: LiteralString, new: LiteralString, count: SupportsIndex = -1, /
) -> LiteralString: ...
@overload
def replace(self, old: str, new: str, count: SupportsIndex = -1, /) -> str: ... # type: ignore[misc]
if sys.version_info >= (3, 9):
@overload
def removeprefix(self: LiteralString, prefix: LiteralString, /) -> LiteralString: ...
@ -1214,6 +1224,9 @@ class property:
fset: Callable[[Any, Any], None] | None
fdel: Callable[[Any], None] | None
__isabstractmethod__: bool
if sys.version_info >= (3, 13):
__name__: str
def __init__(
self,
fget: Callable[[Any], Any] | None = ...,
@ -1321,12 +1334,34 @@ def divmod(x: _T_contra, y: SupportsRDivMod[_T_contra, _T_co], /) -> _T_co: ...
# The `globals` argument to `eval` has to be `dict[str, Any]` rather than `dict[str, object]` due to invariance.
# (The `globals` argument has to be a "real dict", rather than any old mapping, unlike the `locals` argument.)
def eval(
source: str | ReadableBuffer | CodeType, globals: dict[str, Any] | None = None, locals: Mapping[str, object] | None = None, /
) -> Any: ...
if sys.version_info >= (3, 13):
def eval(
source: str | ReadableBuffer | CodeType,
/,
globals: dict[str, Any] | None = None,
locals: Mapping[str, object] | None = None,
) -> Any: ...
else:
def eval(
source: str | ReadableBuffer | CodeType,
globals: dict[str, Any] | None = None,
locals: Mapping[str, object] | None = None,
/,
) -> Any: ...
# Comment above regarding `eval` applies to `exec` as well
if sys.version_info >= (3, 11):
if sys.version_info >= (3, 13):
def exec(
source: str | ReadableBuffer | CodeType,
/,
globals: dict[str, Any] | None = None,
locals: Mapping[str, object] | None = None,
*,
closure: tuple[CellType, ...] | None = None,
) -> None: ...
elif sys.version_info >= (3, 11):
def exec(
source: str | ReadableBuffer | CodeType,
globals: dict[str, Any] | None = None,
@ -2035,3 +2070,7 @@ if sys.version_info >= (3, 11):
def split(
self, condition: Callable[[_ExceptionT_co | Self], bool], /
) -> tuple[ExceptionGroup[_ExceptionT_co] | None, ExceptionGroup[_ExceptionT_co] | None]: ...
if sys.version_info >= (3, 13):
class IncompleteInputError(SyntaxError): ...
class PythonFinalizationError(RuntimeError): ...

View File

@ -4,7 +4,7 @@ import sys
from _typeshed import Unused
from collections.abc import Iterable, Sequence
from time import struct_time
from typing import ClassVar, Literal
from typing import ClassVar, Final
from typing_extensions import TypeAlias
__all__ = [
@ -154,18 +154,18 @@ month_abbr: Sequence[str]
if sys.version_info >= (3, 12):
class Month(enum.IntEnum):
JANUARY: Literal[1]
FEBRUARY: Literal[2]
MARCH: Literal[3]
APRIL: Literal[4]
MAY: Literal[5]
JUNE: Literal[6]
JULY: Literal[7]
AUGUST: Literal[8]
SEPTEMBER: Literal[9]
OCTOBER: Literal[10]
NOVEMBER: Literal[11]
DECEMBER: Literal[12]
JANUARY = 1
FEBRUARY = 2
MARCH = 3
APRIL = 4
MAY = 5
JUNE = 6
JULY = 7
AUGUST = 8
SEPTEMBER = 9
OCTOBER = 10
NOVEMBER = 11
DECEMBER = 12
JANUARY = Month.JANUARY
FEBRUARY = Month.FEBRUARY
@ -181,13 +181,13 @@ if sys.version_info >= (3, 12):
DECEMBER = Month.DECEMBER
class Day(enum.IntEnum):
MONDAY: Literal[0]
TUESDAY: Literal[1]
WEDNESDAY: Literal[2]
THURSDAY: Literal[3]
FRIDAY: Literal[4]
SATURDAY: Literal[5]
SUNDAY: Literal[6]
MONDAY = 0
TUESDAY = 1
WEDNESDAY = 2
THURSDAY = 3
FRIDAY = 4
SATURDAY = 5
SUNDAY = 6
MONDAY = Day.MONDAY
TUESDAY = Day.TUESDAY
@ -197,12 +197,12 @@ if sys.version_info >= (3, 12):
SATURDAY = Day.SATURDAY
SUNDAY = Day.SUNDAY
else:
MONDAY: Literal[0]
TUESDAY: Literal[1]
WEDNESDAY: Literal[2]
THURSDAY: Literal[3]
FRIDAY: Literal[4]
SATURDAY: Literal[5]
SUNDAY: Literal[6]
MONDAY: Final = 0
TUESDAY: Final = 1
WEDNESDAY: Final = 2
THURSDAY: Final = 3
FRIDAY: Final = 4
SATURDAY: Final = 5
SUNDAY: Final = 6
EPOCH: Literal[1970]
EPOCH: Final = 1970

View File

@ -1,3 +1,4 @@
import sys
from codeop import CommandCompiler
from collections.abc import Callable, Mapping
from types import CodeType
@ -18,16 +19,34 @@ class InteractiveInterpreter:
class InteractiveConsole(InteractiveInterpreter):
buffer: list[str] # undocumented
filename: str # undocumented
def __init__(self, locals: Mapping[str, Any] | None = None, filename: str = "<console>") -> None: ...
if sys.version_info >= (3, 13):
def __init__(
self, locals: Mapping[str, Any] | None = None, filename: str = "<console>", *, local_exit: bool = False
) -> None: ...
def push(self, line: str, filename: str | None = None) -> bool: ...
else:
def __init__(self, locals: Mapping[str, Any] | None = None, filename: str = "<console>") -> None: ...
def push(self, line: str) -> bool: ...
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 interact(
banner: str | None = None,
readfunc: Callable[[str], str] | None = None,
local: Mapping[str, Any] | None = None,
exitmsg: str | None = None,
) -> None: ...
if sys.version_info >= (3, 13):
def interact(
banner: str | None = None,
readfunc: Callable[[str], str] | None = None,
local: Mapping[str, Any] | None = None,
exitmsg: str | None = None,
local_exit: bool = False,
) -> None: ...
else:
def interact(
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 = "<input>", symbol: str = "single") -> CodeType | None: ...

View File

@ -54,7 +54,7 @@ class Future(Generic[_T]):
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: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
class Executor:
if sys.version_info >= (3, 9):

View File

@ -29,7 +29,7 @@ class _WorkItem(Generic[_S]):
def __init__(self, future: Future[_S], fn: Callable[..., _S], args: Iterable[Any], kwargs: Mapping[str, Any]) -> None: ...
def run(self) -> None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
def _worker(
executor_reference: ref[Any],

View File

@ -30,7 +30,7 @@ class ContextVar(Generic[_T]):
def set(self, value: _T, /) -> Token[_T]: ...
def reset(self, token: Token[_T], /) -> None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
@final
class Token(Generic[_T]):
@ -40,7 +40,7 @@ class Token(Generic[_T]):
def old_value(self) -> Any: ... # returns either _T or MISSING, but that's hard to express
MISSING: ClassVar[object]
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
def copy_context() -> Context: ...

View File

@ -40,7 +40,6 @@ __all__ = [
"QUOTE_NONE",
"Error",
"Dialect",
"__doc__",
"excel",
"excel_tab",
"field_size_limit",
@ -51,13 +50,14 @@ __all__ = [
"list_dialects",
"Sniffer",
"unregister_dialect",
"__version__",
"DictReader",
"DictWriter",
"unix_dialect",
]
if sys.version_info >= (3, 12):
__all__ += ["QUOTE_STRINGS", "QUOTE_NOTNULL"]
if sys.version_info < (3, 13):
__all__ += ["__doc__", "__version__"]
_T = TypeVar("_T")
@ -111,7 +111,7 @@ class DictReader(Iterator[dict[_T | Any, str | Any]], Generic[_T]):
def __iter__(self) -> Self: ...
def __next__(self) -> dict[_T | Any, str | Any]: ...
if sys.version_info >= (3, 12):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
class DictWriter(Generic[_T]):
fieldnames: Collection[_T]
@ -139,7 +139,7 @@ class DictWriter(Generic[_T]):
def writerow(self, rowdict: Mapping[_T, Any]) -> Any: ...
def writerows(self, rowdicts: Iterable[Mapping[_T, Any]]) -> None: ...
if sys.version_info >= (3, 12):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
class Sniffer:
preferred: list[str]

View File

@ -76,7 +76,7 @@ class LibraryLoader(Generic[_DLLT]):
def __getitem__(self, name: str) -> _DLLT: ...
def LoadLibrary(self, name: str) -> _DLLT: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
cdll: LibraryLoader[CDLL]
if sys.platform == "win32":

View File

@ -5,7 +5,7 @@ from _typeshed import DataclassInstance
from builtins import type as Type # alias to avoid name clashes with fields named "type"
from collections.abc import Callable, Iterable, Mapping
from typing import Any, Generic, Literal, Protocol, TypeVar, overload
from typing_extensions import TypeAlias, TypeGuard
from typing_extensions import TypeAlias, TypeIs
if sys.version_info >= (3, 9):
from types import GenericAlias
@ -143,7 +143,7 @@ class Field(Generic[_T]):
def __set_name__(self, owner: Type[Any], name: str) -> None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
# NOTE: Actual return type is 'Field[_T]', but we want to help type checkers
# to understand the magic that happens at runtime.
@ -214,11 +214,9 @@ else:
def fields(class_or_instance: DataclassInstance | type[DataclassInstance]) -> tuple[Field[Any], ...]: ...
@overload
def is_dataclass(obj: DataclassInstance) -> Literal[True]: ...
def is_dataclass(obj: type) -> TypeIs[type[DataclassInstance]]: ...
@overload
def is_dataclass(obj: type) -> TypeGuard[type[DataclassInstance]]: ...
@overload
def is_dataclass(obj: object) -> TypeGuard[DataclassInstance | type[DataclassInstance]]: ...
def is_dataclass(obj: object) -> TypeIs[DataclassInstance | type[DataclassInstance]]: ...
class FrozenInstanceError(AttributeError): ...

View File

@ -79,6 +79,9 @@ class date:
def isoformat(self) -> str: ...
def timetuple(self) -> struct_time: ...
def toordinal(self) -> int: ...
if sys.version_info >= (3, 13):
def __replace__(self, /, *, year: SupportsIndex = ..., month: SupportsIndex = ..., day: SupportsIndex = ...) -> Self: ...
def replace(self, year: SupportsIndex = ..., month: SupportsIndex = ..., day: SupportsIndex = ...) -> Self: ...
def __le__(self, value: date, /) -> bool: ...
def __lt__(self, value: date, /) -> bool: ...
@ -148,6 +151,19 @@ class time:
def utcoffset(self) -> timedelta | None: ...
def tzname(self) -> str | None: ...
def dst(self) -> timedelta | None: ...
if sys.version_info >= (3, 13):
def __replace__(
self,
/,
*,
hour: SupportsIndex = ...,
minute: SupportsIndex = ...,
second: SupportsIndex = ...,
microsecond: SupportsIndex = ...,
tzinfo: _TzInfo | None = ...,
fold: int = ...,
) -> Self: ...
def replace(
self,
hour: SupportsIndex = ...,
@ -263,6 +279,22 @@ class datetime(date):
def date(self) -> _Date: ...
def time(self) -> _Time: ...
def timetz(self) -> _Time: ...
if sys.version_info >= (3, 13):
def __replace__(
self,
/,
*,
year: SupportsIndex = ...,
month: SupportsIndex = ...,
day: SupportsIndex = ...,
hour: SupportsIndex = ...,
minute: SupportsIndex = ...,
second: SupportsIndex = ...,
microsecond: SupportsIndex = ...,
tzinfo: _TzInfo | None = ...,
fold: int = ...,
) -> Self: ...
def replace(
self,
year: SupportsIndex = ...,

View File

@ -55,7 +55,7 @@ class SequenceMatcher(Generic[_T]):
def quick_ratio(self) -> float: ...
def real_quick_ratio(self) -> float: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
@overload
def get_close_matches(word: AnyStr, possibilities: Iterable[AnyStr], n: int = 3, cutoff: float = 0.6) -> list[AnyStr]: ...

View File

@ -47,7 +47,22 @@ if sys.version_info >= (3, 11):
col_offset: int | None = None
end_col_offset: int | None = None
if sys.version_info >= (3, 11):
if sys.version_info >= (3, 13):
class _Instruction(NamedTuple):
opname: str
opcode: int
arg: int | None
argval: Any
argrepr: str
offset: int
start_offset: int
starts_line: bool
line_number: int | None
label: int | None = None
positions: Positions | None = None
cache_info: list[tuple[str, int, Any]] | None = None
elif sys.version_info >= (3, 11):
class _Instruction(NamedTuple):
opname: str
opcode: int

View File

@ -1,20 +1,35 @@
from _typeshed import StrOrBytesPath, StrPath
from typing import Literal, overload
@overload
def make_archive(
base_name: str,
format: str,
root_dir: str | None = None,
root_dir: StrOrBytesPath | None = None,
base_dir: str | None = None,
verbose: int = 0,
dry_run: int = 0,
verbose: bool | Literal[0, 1] = 0,
dry_run: bool | Literal[0, 1] = 0,
owner: str | None = None,
group: str | None = None,
) -> str: ...
@overload
def make_archive(
base_name: StrPath,
format: str,
root_dir: StrOrBytesPath,
base_dir: str | None = None,
verbose: bool | Literal[0, 1] = 0,
dry_run: bool | Literal[0, 1] = 0,
owner: str | None = None,
group: str | None = None,
) -> str: ...
def make_tarball(
base_name: str,
base_dir: str,
base_dir: StrPath,
compress: str | None = "gzip",
verbose: int = 0,
dry_run: int = 0,
verbose: bool | Literal[0, 1] = 0,
dry_run: bool | Literal[0, 1] = 0,
owner: str | None = None,
group: str | None = None,
) -> str: ...
def make_zipfile(base_name: str, base_dir: str, verbose: int = 0, dry_run: int = 0) -> str: ...
def make_zipfile(base_name: str, base_dir: str, verbose: bool | Literal[0, 1] = 0, dry_run: bool | Literal[0, 1] = 0) -> str: ...

View File

@ -1,5 +1,7 @@
from collections.abc import Callable
from typing import Any
from _typeshed import BytesPath, StrPath
from collections.abc import Callable, Iterable
from distutils.file_util import _BytesPathT, _StrPathT
from typing import Any, Literal, overload
from typing_extensions import TypeAlias
_Macro: TypeAlias = tuple[str] | tuple[str, str | None]
@ -10,7 +12,11 @@ def gen_lib_options(
def gen_preprocess_options(macros: list[_Macro], include_dirs: list[str]) -> list[str]: ...
def get_default_compiler(osname: str | None = None, platform: str | None = None) -> str: ...
def new_compiler(
plat: str | None = None, compiler: str | None = None, verbose: int = 0, dry_run: int = 0, force: int = 0
plat: str | None = None,
compiler: str | None = None,
verbose: bool | Literal[0, 1] = 0,
dry_run: bool | Literal[0, 1] = 0,
force: bool | Literal[0, 1] = 0,
) -> CCompiler: ...
def show_compilers() -> None: ...
@ -25,7 +31,9 @@ class CCompiler:
library_dirs: list[str]
runtime_library_dirs: list[str]
objects: list[str]
def __init__(self, verbose: int = 0, dry_run: int = 0, force: int = 0) -> None: ...
def __init__(
self, verbose: bool | Literal[0, 1] = 0, dry_run: bool | Literal[0, 1] = 0, force: bool | Literal[0, 1] = 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: ...
@ -39,7 +47,7 @@ class CCompiler:
def add_link_object(self, object: str) -> None: ...
def set_link_objects(self, objects: list[str]) -> None: ...
def detect_language(self, sources: str | list[str]) -> str | None: ...
def find_library_file(self, dirs: list[str], lib: str, debug: bool = ...) -> str | None: ...
def find_library_file(self, dirs: list[str], lib: str, debug: bool | Literal[0, 1] = 0) -> str | None: ...
def has_function(
self,
funcname: str,
@ -58,7 +66,7 @@ class CCompiler:
output_dir: str | None = None,
macros: list[_Macro] | None = None,
include_dirs: list[str] | None = None,
debug: bool = ...,
debug: bool | Literal[0, 1] = 0,
extra_preargs: list[str] | None = None,
extra_postargs: list[str] | None = None,
depends: list[str] | None = None,
@ -68,7 +76,7 @@ class CCompiler:
objects: list[str],
output_libname: str,
output_dir: str | None = None,
debug: bool = ...,
debug: bool | Literal[0, 1] = 0,
target_lang: str | None = None,
) -> None: ...
def link(
@ -81,7 +89,7 @@ class CCompiler:
library_dirs: list[str] | None = None,
runtime_library_dirs: list[str] | None = None,
export_symbols: list[str] | None = None,
debug: bool = ...,
debug: bool | Literal[0, 1] = 0,
extra_preargs: list[str] | None = None,
extra_postargs: list[str] | None = None,
build_temp: str | None = None,
@ -95,7 +103,7 @@ class CCompiler:
libraries: list[str] | None = None,
library_dirs: list[str] | None = None,
runtime_library_dirs: list[str] | None = None,
debug: bool = ...,
debug: bool | Literal[0, 1] = 0,
extra_preargs: list[str] | None = None,
extra_postargs: list[str] | None = None,
target_lang: str | None = None,
@ -109,7 +117,7 @@ class CCompiler:
library_dirs: list[str] | None = None,
runtime_library_dirs: list[str] | None = None,
export_symbols: list[str] | None = None,
debug: bool = ...,
debug: bool | Literal[0, 1] = 0,
extra_preargs: list[str] | None = None,
extra_postargs: list[str] | None = None,
build_temp: str | None = None,
@ -124,7 +132,7 @@ class CCompiler:
library_dirs: list[str] | None = None,
runtime_library_dirs: list[str] | None = None,
export_symbols: list[str] | None = None,
debug: bool = ...,
debug: bool | Literal[0, 1] = 0,
extra_preargs: list[str] | None = None,
extra_postargs: list[str] | None = None,
build_temp: str | None = None,
@ -139,14 +147,27 @@ class CCompiler:
extra_preargs: list[str] | None = None,
extra_postargs: list[str] | None = None,
) -> 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: ...
@overload
def executable_filename(self, basename: str, strip_dir: Literal[0, False] = 0, output_dir: StrPath = "") -> str: ...
@overload
def executable_filename(self, basename: StrPath, strip_dir: Literal[1, True], output_dir: StrPath = "") -> str: ...
def library_filename(
self, libname: str, lib_type: str = "static", strip_dir: bool | Literal[0, 1] = 0, output_dir: StrPath = ""
) -> str: ...
def object_filenames(
self, source_filenames: Iterable[StrPath], strip_dir: bool | Literal[0, 1] = 0, output_dir: StrPath | None = ""
) -> list[str]: ...
@overload
def shared_object_filename(self, basename: str, strip_dir: Literal[0, False] = 0, output_dir: StrPath = "") -> str: ...
@overload
def shared_object_filename(self, basename: StrPath, strip_dir: Literal[1, True], output_dir: StrPath = "") -> 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 = 0o777) -> None: ...
def move_file(self, src: str, dst: str) -> str: ...
@overload
def move_file(self, src: StrPath, dst: _StrPathT) -> _StrPathT | str: ...
@overload
def move_file(self, src: BytesPath, dst: _BytesPathT) -> _BytesPathT | bytes: ...
def announce(self, msg: str, level: int = 1) -> None: ...
def warn(self, msg: str) -> None: ...
def debug_print(self, msg: str) -> None: ...

View File

@ -1,12 +1,14 @@
from _typeshed import Incomplete
from _typeshed import BytesPath, Incomplete, StrOrBytesPath, StrPath, Unused
from abc import abstractmethod
from collections.abc import Callable, Iterable
from distutils.dist import Distribution
from typing import Any
from distutils.file_util import _BytesPathT, _StrPathT
from typing import Any, ClassVar, Literal, overload
class Command:
distribution: Distribution
sub_commands: list[tuple[str, Callable[[Command], bool] | None]]
# Any to work around variance issues
sub_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]]
def __init__(self, dist: Distribution) -> None: ...
@abstractmethod
def initialize_options(self) -> None: ...
@ -22,32 +24,63 @@ class Command:
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 = 1) -> Command: ...
def reinitialize_command(self, command: Command | str, reinit_subcommands: int = 0) -> Command: ...
def get_finalized_command(self, command: str, create: bool | Literal[0, 1] = 1) -> Command: ...
def reinitialize_command(self, command: Command | str, reinit_subcommands: bool | Literal[0, 1] = 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 = None, level: int = 1) -> None: ...
def mkpath(self, name: str, mode: int = 0o777) -> None: ...
@overload
def copy_file(
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
self,
infile: StrPath,
outfile: _StrPathT,
preserve_mode: bool | Literal[0, 1] = 1,
preserve_times: bool | Literal[0, 1] = 1,
link: str | None = None,
level: Unused = 1,
) -> tuple[_StrPathT | str, bool]: ...
@overload
def copy_file(
self,
infile: BytesPath,
outfile: _BytesPathT,
preserve_mode: bool | Literal[0, 1] = 1,
preserve_times: bool | Literal[0, 1] = 1,
link: str | None = None,
level: Unused = 1,
) -> tuple[_BytesPathT | bytes, bool]: ...
def copy_tree(
self,
infile: str,
infile: StrPath,
outfile: str,
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 = 1) -> str: ... # level is not used
def spawn(self, cmd: Iterable[str], search_path: int = 1, level: Any = 1) -> None: ... # level is not used
preserve_mode: bool | Literal[0, 1] = 1,
preserve_times: bool | Literal[0, 1] = 1,
preserve_symlinks: bool | Literal[0, 1] = 0,
level: Unused = 1,
) -> list[str]: ...
@overload
def move_file(self, src: StrPath, dst: _StrPathT, level: Unused = 1) -> _StrPathT | str: ...
@overload
def move_file(self, src: BytesPath, dst: _BytesPathT, level: Unused = 1) -> _BytesPathT | bytes: ...
def spawn(self, cmd: Iterable[str], search_path: bool | Literal[0, 1] = 1, level: Unused = 1) -> None: ...
@overload
def make_archive(
self,
base_name: str,
format: str,
root_dir: str | None = None,
root_dir: StrOrBytesPath | None = None,
base_dir: str | None = None,
owner: str | None = None,
group: str | None = None,
) -> str: ...
@overload
def make_archive(
self,
base_name: StrPath,
format: str,
root_dir: StrOrBytesPath,
base_dir: str | None = None,
owner: str | None = None,
group: str | None = None,
@ -55,12 +88,12 @@ class Command:
def make_file(
self,
infiles: str | list[str] | tuple[str, ...],
outfile: str,
outfile: StrOrBytesPath,
func: Callable[..., object],
args: list[Any],
exec_msg: str | None = None,
skip_msg: str | None = None,
level: Any = 1,
) -> None: ... # level is not used
level: Unused = 1,
) -> None: ...
def ensure_finalized(self) -> None: ...
def dump_options(self, header: Incomplete | None = None, indent: str = "") -> None: ...

View File

@ -1,5 +1,5 @@
import sys
from typing import Any
from typing import Any, Literal
from ..cmd import Command
@ -9,9 +9,9 @@ if sys.platform == "win32":
class PyDialog(Dialog):
def __init__(self, *args, **kw) -> None: ...
def title(self, title) -> None: ...
def back(self, title, next, name: str = "Back", active: int = 1): ...
def cancel(self, title, next, name: str = "Cancel", active: int = 1): ...
def next(self, title, next, name: str = "Next", active: int = 1): ...
def back(self, title, next, name: str = "Back", active: bool | Literal[0, 1] = 1): ...
def cancel(self, title, next, name: str = "Cancel", active: bool | Literal[0, 1] = 1): ...
def next(self, title, next, name: str = "Next", active: bool | Literal[0, 1] = 1): ...
def xbutton(self, name, title, next, xpos): ...
class bdist_msi(Command):

View File

@ -1,4 +1,5 @@
from typing import Any
from collections.abc import Callable
from typing import Any, ClassVar
from ..cmd import Command
@ -28,4 +29,5 @@ class build(Command):
def has_c_libraries(self): ...
def has_ext_modules(self): ...
def has_scripts(self): ...
sub_commands: Any
# Any to work around variance issues
sub_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]]

View File

@ -1,4 +1,4 @@
from typing import Any
from typing import Any, Literal
from ..cmd import Command
from ..util import Mixin2to3 as Mixin2to3
@ -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 = 1): ...
def get_outputs(self, include_bytecode: bool | Literal[0, 1] = 1): ...
def build_module(self, module, module_file, package): ...
def build_modules(self) -> None: ...
def build_packages(self) -> None: ...

View File

@ -1,4 +1,4 @@
from typing import Any
from typing import Any, Literal
from typing_extensions import TypeAlias
from ..cmd import Command
@ -16,7 +16,7 @@ class SilentReporter(_Reporter):
report_level,
halt_level,
stream: Any | None = ...,
debug: int = ...,
debug: bool | Literal[0, 1] = 0,
encoding: str = ...,
error_handler: str = ...,
) -> None: ...

View File

@ -1,6 +1,7 @@
from _typeshed import StrOrBytesPath
from collections.abc import Sequence
from re import Pattern
from typing import Any
from typing import Any, Literal
from ..ccompiler import CCompiler
from ..cmd import Command
@ -65,8 +66,8 @@ class config(Command):
include_dirs: Sequence[str] | None = None,
libraries: Sequence[str] | None = None,
library_dirs: Sequence[str] | None = None,
decl: int = 0,
call: int = 0,
decl: bool | Literal[0, 1] = 0,
call: bool | Literal[0, 1] = 0,
) -> bool: ...
def check_lib(
self,
@ -80,4 +81,4 @@ class config(Command):
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) -> None: ...
def dump_file(filename: StrOrBytesPath, head: Any | None = None) -> None: ...

View File

@ -1,4 +1,5 @@
from typing import Any
from collections.abc import Callable
from typing import Any, ClassVar
from ..cmd import Command
@ -60,4 +61,5 @@ class install(Command):
def has_headers(self): ...
def has_scripts(self): ...
def has_data(self): ...
sub_commands: Any
# Any to work around variance issues
sub_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]]

View File

@ -1,10 +1,12 @@
from typing import Any
from collections.abc import Callable
from typing import Any, ClassVar
from ..config import PyPIRCCommand
class register(PyPIRCCommand):
description: str
sub_commands: Any
# Any to work around variance issues
sub_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]]
list_classifiers: int
strict: int
def initialize_options(self) -> None: ...

View File

@ -1,4 +1,5 @@
from typing import Any
from collections.abc import Callable
from typing import Any, ClassVar
from ..cmd import Command
@ -11,7 +12,8 @@ class sdist(Command):
boolean_options: Any
help_options: Any
negative_opt: Any
sub_commands: Any
# Any to work around variance issues
sub_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]]
READMES: Any
template: Any
manifest: Any

View File

@ -3,7 +3,7 @@ from collections.abc import Mapping
from distutils.cmd import Command as Command
from distutils.dist import Distribution as Distribution
from distutils.extension import Extension as Extension
from typing import Any
from typing import Any, Literal
USAGE: str
@ -45,7 +45,7 @@ def setup(
command_packages: list[str] = ...,
command_options: Mapping[str, Mapping[str, tuple[Any, Any]]] = ...,
package_data: Mapping[str, list[str]] = ...,
include_package_data: bool = ...,
include_package_data: bool | Literal[0, 1] = ...,
libraries: list[str] = ...,
headers: list[str] = ...,
ext_package: str = ...,

View File

@ -1,3 +1,14 @@
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 = "error") -> bool: ...
from _typeshed import StrOrBytesPath, SupportsLenAndGetItem
from collections.abc import Iterable
from typing import Literal, TypeVar
_SourcesT = TypeVar("_SourcesT", bound=StrOrBytesPath)
_TargetsT = TypeVar("_TargetsT", bound=StrOrBytesPath)
def newer(source: StrOrBytesPath, target: StrOrBytesPath) -> bool | Literal[1]: ...
def newer_pairwise(
sources: SupportsLenAndGetItem[_SourcesT], targets: SupportsLenAndGetItem[_TargetsT]
) -> tuple[list[_SourcesT], list[_TargetsT]]: ...
def newer_group(
sources: Iterable[StrOrBytesPath], target: StrOrBytesPath, missing: Literal["error", "ignore", "newer"] = "error"
) -> Literal[0, 1]: ...

View File

@ -1,13 +1,23 @@
def mkpath(name: str, mode: int = 0o777, verbose: int = 1, dry_run: int = 0) -> list[str]: ...
def create_tree(base_dir: str, files: list[str], mode: int = 0o777, verbose: int = 1, dry_run: int = 0) -> None: ...
from _typeshed import StrOrBytesPath, StrPath
from collections.abc import Iterable
from typing import Literal
def mkpath(name: str, mode: int = 0o777, verbose: bool | Literal[0, 1] = 1, dry_run: bool | Literal[0, 1] = 0) -> list[str]: ...
def create_tree(
base_dir: StrPath,
files: Iterable[StrPath],
mode: int = 0o777,
verbose: bool | Literal[0, 1] = 1,
dry_run: bool | Literal[0, 1] = 0,
) -> None: ...
def copy_tree(
src: str,
src: StrPath,
dst: str,
preserve_mode: int = 1,
preserve_times: int = 1,
preserve_symlinks: int = 0,
update: int = 0,
verbose: int = 1,
dry_run: int = 0,
preserve_mode: bool | Literal[0, 1] = 1,
preserve_times: bool | Literal[0, 1] = 1,
preserve_symlinks: bool | Literal[0, 1] = 0,
update: bool | Literal[0, 1] = 0,
verbose: bool | Literal[0, 1] = 1,
dry_run: bool | Literal[0, 1] = 0,
) -> list[str]: ...
def remove_tree(directory: str, verbose: int = 1, dry_run: int = 0) -> None: ...
def remove_tree(directory: StrOrBytesPath, verbose: bool | Literal[0, 1] = 1, dry_run: bool | Literal[0, 1] = 0) -> None: ...

View File

@ -1,8 +1,8 @@
from _typeshed import FileDescriptorOrPath, Incomplete, SupportsWrite
from _typeshed import Incomplete, StrOrBytesPath, StrPath, SupportsWrite
from collections.abc import Iterable, Mapping
from distutils.cmd import Command
from re import Pattern
from typing import IO, Any, ClassVar, TypeVar, overload
from typing import IO, Any, ClassVar, Literal, TypeVar, overload
from typing_extensions import TypeAlias
command_re: Pattern[str]
@ -11,7 +11,7 @@ _OptionsList: TypeAlias = list[tuple[str, str | None, str, int] | tuple[str, str
_CommandT = TypeVar("_CommandT", bound=Command)
class DistributionMetadata:
def __init__(self, path: FileDescriptorOrPath | None = None) -> None: ...
def __init__(self, path: StrOrBytesPath | None = None) -> None: ...
name: str | None
version: str | None
author: str | None
@ -30,7 +30,7 @@ class DistributionMetadata:
requires: list[str] | None
obsoletes: list[str] | None
def read_pkg_file(self, file: IO[str]) -> None: ...
def write_pkg_info(self, base_dir: str) -> None: ...
def write_pkg_info(self, base_dir: StrPath) -> None: ...
def write_pkg_file(self, file: SupportsWrite[str]) -> None: ...
def get_name(self) -> str: ...
def get_version(self) -> str: ...
@ -63,7 +63,10 @@ class Distribution:
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) -> None: ...
def get_command_obj(self, command: str, create: bool = True) -> Command | None: ...
@overload
def get_command_obj(self, command: str, create: Literal[1, True] = 1) -> Command: ...
@overload
def get_command_obj(self, command: str, create: Literal[0, False]) -> Command | None: ...
global_options: ClassVar[_OptionsList]
common_usage: ClassVar[str]
display_options: ClassVar[_OptionsList]

View File

@ -1,14 +1,38 @@
from collections.abc import Sequence
from _typeshed import BytesPath, StrOrBytesPath, StrPath
from collections.abc import Iterable
from typing import Literal, TypeVar, overload
_StrPathT = TypeVar("_StrPathT", bound=StrPath)
_BytesPathT = TypeVar("_BytesPathT", bound=BytesPath)
@overload
def copy_file(
src: str,
dst: str,
preserve_mode: bool = ...,
preserve_times: bool = ...,
update: bool = ...,
src: StrPath,
dst: _StrPathT,
preserve_mode: bool | Literal[0, 1] = 1,
preserve_times: bool | Literal[0, 1] = 1,
update: bool | Literal[0, 1] = 0,
link: str | None = None,
verbose: bool = ...,
dry_run: bool = ...,
) -> tuple[str, str]: ...
def move_file(src: str, dst: str, verbose: bool = ..., dry_run: bool = ...) -> str: ...
def write_file(filename: str, contents: Sequence[str]) -> None: ...
verbose: bool | Literal[0, 1] = 1,
dry_run: bool | Literal[0, 1] = 0,
) -> tuple[_StrPathT | str, bool]: ...
@overload
def copy_file(
src: BytesPath,
dst: _BytesPathT,
preserve_mode: bool | Literal[0, 1] = 1,
preserve_times: bool | Literal[0, 1] = 1,
update: bool | Literal[0, 1] = 0,
link: str | None = None,
verbose: bool | Literal[0, 1] = 1,
dry_run: bool | Literal[0, 1] = 0,
) -> tuple[_BytesPathT | bytes, bool]: ...
@overload
def move_file(
src: StrPath, dst: _StrPathT, verbose: bool | Literal[0, 1] = 0, dry_run: bool | Literal[0, 1] = 0
) -> _StrPathT | str: ...
@overload
def move_file(
src: BytesPath, dst: _BytesPathT, verbose: bool | Literal[0, 1] = 0, dry_run: bool | Literal[0, 1] = 0
) -> _BytesPathT | bytes: ...
def write_file(filename: StrOrBytesPath, contents: Iterable[str]) -> None: ...

View File

@ -23,7 +23,11 @@ class FileList:
def include_pattern(self, pattern: str | Pattern[str], *, is_regex: Literal[True, 1]) -> bool: ...
@overload
def include_pattern(
self, pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: int = 0
self,
pattern: str | Pattern[str],
anchor: bool | Literal[0, 1] = 1,
prefix: str | None = None,
is_regex: bool | Literal[0, 1] = 0,
) -> bool: ...
@overload
def exclude_pattern(
@ -33,7 +37,11 @@ class FileList:
def exclude_pattern(self, pattern: str | Pattern[str], *, is_regex: Literal[True, 1]) -> bool: ...
@overload
def exclude_pattern(
self, pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: int = 0
self,
pattern: str | Pattern[str],
anchor: bool | Literal[0, 1] = 1,
prefix: str | None = None,
is_regex: bool | Literal[0, 1] = 0,
) -> bool: ...
def findall(dir: str = ".") -> list[str]: ...
@ -46,5 +54,5 @@ def translate_pattern(
def translate_pattern(pattern: str | Pattern[str], *, is_regex: Literal[True, 1]) -> Pattern[str]: ...
@overload
def translate_pattern(
pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: int = 0
pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: bool | Literal[0, 1] = 0
) -> Pattern[str]: ...

View File

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

View File

@ -23,8 +23,10 @@ def get_config_vars() -> dict[str, str | int]: ...
def get_config_vars(arg: str, /, *args: str) -> list[str | int]: ...
def get_config_h_filename() -> str: ...
def get_makefile_filename() -> 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 get_python_inc(plat_specific: bool | Literal[0, 1] = 0, prefix: str | None = None) -> str: ...
def get_python_lib(
plat_specific: bool | Literal[0, 1] = 0, standard_lib: bool | Literal[0, 1] = 0, prefix: str | None = None
) -> str: ...
def customize_compiler(compiler: CCompiler) -> None: ...
if sys.version_info < (3, 10):

View File

@ -1,4 +1,4 @@
from typing import IO
from typing import IO, Literal
class TextFile:
def __init__(
@ -6,12 +6,12 @@ class TextFile:
filename: str | None = None,
file: IO[str] | None = None,
*,
strip_comments: bool = ...,
lstrip_ws: bool = ...,
rstrip_ws: bool = ...,
skip_blanks: bool = ...,
join_lines: bool = ...,
collapse_join: bool = ...,
strip_comments: bool | Literal[0, 1] = ...,
lstrip_ws: bool | Literal[0, 1] = ...,
rstrip_ws: bool | Literal[0, 1] = ...,
skip_blanks: bool | Literal[0, 1] = ...,
join_lines: bool | Literal[0, 1] = ...,
collapse_join: bool | Literal[0, 1] = ...,
) -> None: ...
def open(self, filename: str) -> None: ...
def close(self) -> None: ...

View File

@ -5,22 +5,26 @@ from typing import Any, Literal
def get_host_platform() -> str: ...
def get_platform() -> str: ...
def convert_path(pathname: str) -> str: ...
def change_root(new_root: str, pathname: str) -> str: ...
def change_root(new_root: StrPath, pathname: StrPath) -> str: ...
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 = None, verbose: bool = ..., dry_run: bool = ...
func: Callable[..., object],
args: tuple[Any, ...],
msg: str | None = None,
verbose: bool | Literal[0, 1] = 0,
dry_run: bool | Literal[0, 1] = 0,
) -> None: ...
def strtobool(val: str) -> Literal[0, 1]: ...
def byte_compile(
py_files: list[str],
optimize: int = 0,
force: bool = ...,
force: bool | Literal[0, 1] = 0,
prefix: str | None = None,
base_dir: str | None = None,
verbose: bool = ...,
dry_run: bool = ...,
verbose: bool | Literal[0, 1] = 1,
dry_run: bool | Literal[0, 1] = 0,
direct: bool | None = None,
) -> None: ...
def rfc822_escape(header: str) -> str: ...

View File

@ -10,4 +10,4 @@ def is_enabled() -> bool: ...
if sys.platform != "win32":
def register(signum: int, file: FileDescriptorLike = ..., all_threads: bool = ..., chain: bool = ...) -> None: ...
def unregister(signum: int) -> None: ...
def unregister(signum: int, /) -> None: ...

View File

@ -52,6 +52,6 @@ class dircmp(Generic[AnyStr]):
def phase4(self) -> None: ...
def phase4_closure(self) -> None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
def clear_cache() -> None: ...

View File

@ -200,7 +200,7 @@ class FileInput(Iterator[AnyStr]):
def isfirstline(self) -> bool: ...
def isstdin(self) -> bool: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
if sys.version_info >= (3, 10):
def hook_compressed(

View File

@ -132,7 +132,7 @@ class partial(Generic[_T]):
def __new__(cls, func: Callable[..., _T], /, *args: Any, **kwargs: Any) -> Self: ...
def __call__(self, /, *args: Any, **kwargs: Any) -> _T: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
# With protocols, this could change into a generic protocol that defines __get__ and returns _T
_Descriptor: TypeAlias = Any
@ -149,7 +149,7 @@ class partialmethod(Generic[_T]):
@property
def __isabstractmethod__(self) -> bool: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
class _SingleDispatchCallable(Generic[_T]):
registry: types.MappingProxyType[Any, Callable[..., _T]]
@ -196,7 +196,7 @@ class cached_property(Generic[_T_co]):
# __set__ is not defined at runtime, but @cached_property is designed to be settable
def __set__(self, instance: object, value: _T_co) -> None: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues]
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
if sys.version_info >= (3, 9):
def cache(user_function: Callable[..., _T], /) -> _lru_cache_wrapper[_T]: ...

View File

@ -20,6 +20,8 @@ __all__ = [
]
if sys.version_info >= (3, 12):
__all__ += ["islink"]
if sys.version_info >= (3, 13):
__all__ += ["isjunction", "isdevdrive", "lexists"]
# All overloads can return empty string. Ideally, Literal[""] would be a valid
# Iterable[T], so that list[T] | Literal[""] could be used as a return
@ -50,3 +52,8 @@ def getctime(filename: FileDescriptorOrPath) -> float: ...
def samefile(f1: FileDescriptorOrPath, f2: FileDescriptorOrPath) -> bool: ...
def sameopenfile(fp1: int, fp2: int) -> bool: ...
def samestat(s1: os.stat_result, s2: os.stat_result) -> bool: ...
if sys.version_info >= (3, 13):
def isjunction(path: StrOrBytesPath) -> bool: ...
def isdevdrive(path: StrOrBytesPath) -> bool: ...
def lexists(path: StrOrBytesPath) -> bool: ...

View File

@ -23,6 +23,6 @@ class TopologicalSorter(Generic[_T]):
def get_ready(self) -> tuple[_T, ...]: ...
def static_order(self) -> Iterable[_T]: ...
if sys.version_info >= (3, 11):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
class CycleError(ValueError): ...

View File

@ -12,8 +12,8 @@ _ReadBinaryMode: TypeAlias = Literal["r", "rb"]
_WriteBinaryMode: TypeAlias = Literal["a", "ab", "w", "wb", "x", "xb"]
_OpenTextMode: TypeAlias = Literal["rt", "at", "wt", "xt"]
READ: Literal[1] # undocumented
WRITE: Literal[2] # undocumented
READ: object # undocumented
WRITE: object # undocumented
FTEXT: int # actually Literal[1] # undocumented
FHCRC: int # actually Literal[2] # undocumented
@ -86,7 +86,7 @@ class BadGzipFile(OSError): ...
class GzipFile(_compression.BaseStream):
myfileobj: FileIO | None
mode: Literal[1, 2]
mode: object
name: str
compress: zlib._Compress
fileobj: _ReadableFileobj | _WritableFileobj

View File

@ -1,6 +1,5 @@
import sys
from enum import IntEnum
from typing import Literal
if sys.version_info >= (3, 11):
from enum import StrEnum
@ -49,11 +48,19 @@ class HTTPStatus(IntEnum):
GONE = 410
LENGTH_REQUIRED = 411
PRECONDITION_FAILED = 412
if sys.version_info >= (3, 13):
CONTENT_TOO_LARGE = 413
REQUEST_ENTITY_TOO_LARGE = 413
if sys.version_info >= (3, 13):
URI_TOO_LONG = 414
REQUEST_URI_TOO_LONG = 414
UNSUPPORTED_MEDIA_TYPE = 415
if sys.version_info >= (3, 13):
RANGE_NOT_SATISFIABLE = 416
REQUESTED_RANGE_NOT_SATISFIABLE = 416
EXPECTATION_FAILED = 417
if sys.version_info >= (3, 13):
UNPROCESSABLE_CONTENT = 422
UNPROCESSABLE_ENTITY = 422
LOCKED = 423
FAILED_DEPENDENCY = 424
@ -75,9 +82,9 @@ class HTTPStatus(IntEnum):
MISDIRECTED_REQUEST = 421
UNAVAILABLE_FOR_LEGAL_REASONS = 451
if sys.version_info >= (3, 9):
EARLY_HINTS: Literal[103]
IM_A_TEAPOT: Literal[418]
TOO_EARLY: Literal[425]
EARLY_HINTS = 103
IM_A_TEAPOT = 418
TOO_EARLY = 425
if sys.version_info >= (3, 12):
@property
def is_informational(self) -> bool: ...

View File

@ -45,7 +45,7 @@ class Morsel(dict[str, Any], Generic[_T]):
def __eq__(self, morsel: object) -> bool: ...
def __setitem__(self, K: str, V: Any) -> None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
class BaseCookie(dict[str, Morsel[_T]], Generic[_T]):
def __init__(self, input: _DataType | None = None) -> None: ...

View File

@ -240,7 +240,10 @@ class DistributionFinder(MetaPathFinder):
class MetadataPathFinder(DistributionFinder):
@classmethod
def find_distributions(cls, context: DistributionFinder.Context = ...) -> Iterable[PathDistribution]: ...
if sys.version_info >= (3, 10):
if sys.version_info >= (3, 11):
@classmethod
def invalidate_caches(cls) -> None: ...
elif sys.version_info >= (3, 10):
# Yes, this is an instance method that has a parameter named "cls"
def invalidate_caches(cls) -> None: ...

View File

@ -318,6 +318,7 @@ class Signature:
def bind(self, *args: Any, **kwargs: Any) -> BoundArguments: ...
def bind_partial(self, *args: Any, **kwargs: Any) -> BoundArguments: ...
def replace(self, *, parameters: Sequence[Parameter] | type[_void] | None = ..., return_annotation: Any = ...) -> Self: ...
__replace__ = replace
if sys.version_info >= (3, 10):
@classmethod
def from_callable(
@ -332,6 +333,8 @@ class Signature:
else:
@classmethod
def from_callable(cls, obj: _IntrospectableCallable, *, follow_wrapped: bool = True) -> Self: ...
if sys.version_info >= (3, 13):
def format(self, *, max_width: int | None = None) -> str: ...
def __eq__(self, other: object) -> bool: ...
def __hash__(self) -> int: ...
@ -392,6 +395,9 @@ class Parameter:
default: Any = ...,
annotation: Any = ...,
) -> Self: ...
if sys.version_info >= (3, 13):
__replace__ = replace
def __eq__(self, other: object) -> bool: ...
def __hash__(self) -> int: ...

View File

@ -75,7 +75,7 @@ class IOBase(metaclass=abc.ABCMeta):
def __del__(self) -> None: ...
@property
def closed(self) -> bool: ...
def _checkClosed(self, msg: str | None = ...) -> None: ... # undocumented
def _checkClosed(self) -> None: ... # undocumented
class RawIOBase(IOBase):
def readall(self) -> bytes: ...

View File

@ -147,7 +147,11 @@ class _BaseV4:
@property
def max_prefixlen(self) -> Literal[32]: ...
class IPv4Address(_BaseV4, _BaseAddress): ...
class IPv4Address(_BaseV4, _BaseAddress):
if sys.version_info >= (3, 13):
@property
def ipv6_mapped(self) -> IPv6Address: ...
class IPv4Network(_BaseV4, _BaseNetwork[IPv4Address]): ...
class IPv4Interface(IPv4Address, _BaseInterface[IPv4Address, IPv4Network]):

View File

@ -17,6 +17,10 @@ _T3 = TypeVar("_T3")
_T4 = TypeVar("_T4")
_T5 = TypeVar("_T5")
_T6 = TypeVar("_T6")
_T7 = TypeVar("_T7")
_T8 = TypeVar("_T8")
_T9 = TypeVar("_T9")
_T10 = TypeVar("_T10")
_Step: TypeAlias = SupportsFloat | SupportsInt | SupportsIndex | SupportsComplex
@ -214,6 +218,60 @@ class product(Iterator[_T_co]):
/,
) -> product[tuple[_T1, _T2, _T3, _T4, _T5, _T6]]: ...
@overload
def __new__(
cls,
iter1: Iterable[_T1],
iter2: Iterable[_T2],
iter3: Iterable[_T3],
iter4: Iterable[_T4],
iter5: Iterable[_T5],
iter6: Iterable[_T6],
iter7: Iterable[_T7],
/,
) -> product[tuple[_T1, _T2, _T3, _T4, _T5, _T6, _T7]]: ...
@overload
def __new__(
cls,
iter1: Iterable[_T1],
iter2: Iterable[_T2],
iter3: Iterable[_T3],
iter4: Iterable[_T4],
iter5: Iterable[_T5],
iter6: Iterable[_T6],
iter7: Iterable[_T7],
iter8: Iterable[_T8],
/,
) -> product[tuple[_T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8]]: ...
@overload
def __new__(
cls,
iter1: Iterable[_T1],
iter2: Iterable[_T2],
iter3: Iterable[_T3],
iter4: Iterable[_T4],
iter5: Iterable[_T5],
iter6: Iterable[_T6],
iter7: Iterable[_T7],
iter8: Iterable[_T8],
iter9: Iterable[_T9],
/,
) -> product[tuple[_T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9]]: ...
@overload
def __new__(
cls,
iter1: Iterable[_T1],
iter2: Iterable[_T2],
iter3: Iterable[_T3],
iter4: Iterable[_T4],
iter5: Iterable[_T5],
iter6: Iterable[_T6],
iter7: Iterable[_T7],
iter8: Iterable[_T8],
iter9: Iterable[_T9],
iter10: Iterable[_T10],
/,
) -> product[tuple[_T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10]]: ...
@overload
def __new__(cls, *iterables: Iterable[_T1], repeat: int = 1) -> product[tuple[_T1, ...]]: ...
def __iter__(self) -> Self: ...
def __next__(self) -> _T_co: ...

View File

@ -10,8 +10,8 @@ INFINITY: float
def py_encode_basestring(s: str) -> str: ... # undocumented
def py_encode_basestring_ascii(s: str) -> str: ... # undocumented
def encode_basestring(s: str) -> str: ... # undocumented
def encode_basestring_ascii(s: str) -> str: ... # undocumented
def encode_basestring(s: str, /) -> str: ... # undocumented
def encode_basestring_ascii(s: str, /) -> str: ... # undocumented
class JSONEncoder:
item_separator: str

View File

@ -7,14 +7,14 @@ if sys.version_info >= (3, 9):
else:
__all__ = ["iskeyword", "kwlist"]
def iskeyword(s: str) -> bool: ...
def iskeyword(s: str, /) -> bool: ...
# a list at runtime, but you're not meant to mutate it;
# type it as a sequence
kwlist: Final[Sequence[str]]
if sys.version_info >= (3, 9):
def issoftkeyword(s: str) -> bool: ...
def issoftkeyword(s: str, /) -> bool: ...
# a list at runtime, but you're not meant to mutate it;
# type it as a sequence

View File

@ -96,7 +96,6 @@ __all__ = [
"getpreferredencoding",
"Error",
"setlocale",
"resetlocale",
"localeconv",
"strcoll",
"strxfrm",
@ -121,6 +120,9 @@ if sys.version_info >= (3, 11):
if sys.version_info < (3, 12):
__all__ += ["format"]
if sys.version_info < (3, 13):
__all__ += ["resetlocale"]
if sys.platform != "win32":
__all__ += ["LC_MESSAGES"]
@ -133,7 +135,9 @@ def getlocale(category: int = ...) -> tuple[_str | None, _str | None]: ...
def setlocale(category: int, locale: _str | Iterable[_str | None] | None = None) -> _str: ...
def getpreferredencoding(do_setlocale: bool = True) -> _str: ...
def normalize(localename: _str) -> _str: ...
def resetlocale(category: int = ...) -> None: ...
if sys.version_info < (3, 13):
def resetlocale(category: int = ...) -> None: ...
if sys.version_info < (3, 12):
def format(

View File

@ -50,7 +50,6 @@ __all__ = [
"makeLogRecord",
"setLoggerClass",
"shutdown",
"warn",
"warning",
"getLogRecordFactory",
"setLogRecordFactory",
@ -58,6 +57,8 @@ __all__ = [
"raiseExceptions",
]
if sys.version_info < (3, 13):
__all__ += ["warn"]
if sys.version_info >= (3, 11):
__all__ += ["getLevelNamesMapping"]
if sys.version_info >= (3, 12):
@ -156,15 +157,17 @@ class Logger(Filterer):
stacklevel: int = 1,
extra: Mapping[str, object] | None = None,
) -> None: ...
def warn(
self,
msg: object,
*args: object,
exc_info: _ExcInfoType = None,
stack_info: bool = False,
stacklevel: int = 1,
extra: Mapping[str, object] | None = None,
) -> None: ...
if sys.version_info < (3, 13):
def warn(
self,
msg: object,
*args: object,
exc_info: _ExcInfoType = None,
stack_info: bool = False,
stacklevel: int = 1,
extra: Mapping[str, object] | None = None,
) -> None: ...
def error(
self,
msg: object,
@ -365,13 +368,19 @@ _L = TypeVar("_L", bound=Logger | LoggerAdapter[Any])
class LoggerAdapter(Generic[_L]):
logger: _L
manager: Manager # undocumented
if sys.version_info >= (3, 10):
extra: Mapping[str, object] | None
if sys.version_info >= (3, 13):
def __init__(self, logger: _L, extra: Mapping[str, object] | None = None, merge_extra: bool = False) -> None: ...
elif sys.version_info >= (3, 10):
def __init__(self, logger: _L, extra: Mapping[str, object] | None = None) -> None: ...
else:
extra: Mapping[str, object]
def __init__(self, logger: _L, extra: Mapping[str, object]) -> None: ...
if sys.version_info >= (3, 10):
extra: Mapping[str, object] | None
else:
extra: Mapping[str, object]
def process(self, msg: Any, kwargs: MutableMapping[str, Any]) -> tuple[Any, MutableMapping[str, Any]]: ...
def debug(
self,
@ -403,16 +412,18 @@ class LoggerAdapter(Generic[_L]):
extra: Mapping[str, object] | None = None,
**kwargs: object,
) -> None: ...
def warn(
self,
msg: object,
*args: object,
exc_info: _ExcInfoType = None,
stack_info: bool = False,
stacklevel: int = 1,
extra: Mapping[str, object] | None = None,
**kwargs: object,
) -> None: ...
if sys.version_info < (3, 13):
def warn(
self,
msg: object,
*args: object,
exc_info: _ExcInfoType = None,
stack_info: bool = False,
stacklevel: int = 1,
extra: Mapping[str, object] | None = None,
**kwargs: object,
) -> None: ...
def error(
self,
msg: object,
@ -458,19 +469,32 @@ class LoggerAdapter(Generic[_L]):
def getEffectiveLevel(self) -> int: ...
def setLevel(self, level: _Level) -> None: ...
def hasHandlers(self) -> bool: ...
def _log(
self,
level: int,
msg: object,
args: _ArgsType,
exc_info: _ExcInfoType | None = None,
extra: Mapping[str, object] | None = None,
stack_info: bool = False,
) -> None: ... # undocumented
if sys.version_info >= (3, 11):
def _log(
self,
level: int,
msg: object,
args: _ArgsType,
*,
exc_info: _ExcInfoType | None = None,
extra: Mapping[str, object] | None = None,
stack_info: bool = False,
) -> None: ... # undocumented
else:
def _log(
self,
level: int,
msg: object,
args: _ArgsType,
exc_info: _ExcInfoType | None = None,
extra: Mapping[str, object] | None = None,
stack_info: bool = False,
) -> None: ... # undocumented
@property
def name(self) -> str: ... # undocumented
if sys.version_info >= (3, 11):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
def getLogger(name: str | None = None) -> Logger: ...
def getLoggerClass() -> type[Logger]: ...
@ -499,14 +523,17 @@ def warning(
stacklevel: int = 1,
extra: Mapping[str, object] | None = None,
) -> None: ...
def warn(
msg: object,
*args: object,
exc_info: _ExcInfoType = None,
stack_info: bool = False,
stacklevel: int = 1,
extra: Mapping[str, object] | None = None,
) -> None: ...
if sys.version_info < (3, 13):
def warn(
msg: object,
*args: object,
exc_info: _ExcInfoType = None,
stack_info: bool = False,
stacklevel: int = 1,
extra: Mapping[str, object] | None = None,
) -> None: ...
def error(
msg: object,
*args: object,
@ -600,7 +627,7 @@ class StreamHandler(Handler, Generic[_StreamT]):
def __init__(self: StreamHandler[_StreamT], stream: _StreamT) -> None: ... # pyright: ignore[reportInvalidTypeVarUse] #11780
def setStream(self, stream: _StreamT) -> _StreamT | None: ...
if sys.version_info >= (3, 11):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
class FileHandler(StreamHandler[TextIOWrapper]):
baseFilename: str # undocumented

View File

@ -46,7 +46,7 @@ class BaseRotatingHandler(FileHandler):
def rotate(self, source: str, dest: str) -> None: ...
class RotatingFileHandler(BaseRotatingHandler):
maxBytes: str # undocumented
maxBytes: int # undocumented
backupCount: int # undocumented
if sys.version_info >= (3, 9):
def __init__(

View File

@ -102,7 +102,7 @@ class Mailbox(Generic[_MessageT]):
@abstractmethod
def close(self) -> None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
class Maildir(Mailbox[MaildirMessage]):
colon: str
@ -244,7 +244,7 @@ class _ProxyFile(Generic[AnyStr]):
@property
def closed(self) -> bool: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
class _PartialFile(_ProxyFile[AnyStr]):
def __init__(self, f: IO[AnyStr], start: int | None = None, stop: int | None = None) -> None: ...

View File

@ -1,4 +1,5 @@
import builtins
import sys
import types
from _typeshed import ReadableBuffer, SupportsRead, SupportsWrite
from typing import Any
@ -27,7 +28,14 @@ _Marshallable: TypeAlias = (
| ReadableBuffer
)
def dump(value: _Marshallable, file: SupportsWrite[bytes], version: int = 4, /) -> None: ...
def load(file: SupportsRead[bytes], /) -> Any: ...
def dumps(value: _Marshallable, version: int = 4, /) -> bytes: ...
def loads(bytes: ReadableBuffer, /) -> Any: ...
if sys.version_info >= (3, 13):
def dump(value: _Marshallable, file: SupportsWrite[bytes], version: int = 4, /, *, allow_code: bool = True) -> None: ...
def load(file: SupportsRead[bytes], /, *, allow_code: bool = True) -> Any: ...
def dumps(value: _Marshallable, version: int = 4, /, *, allow_code: bool = True) -> bytes: ...
def loads(bytes: ReadableBuffer, /, *, allow_code: bool = True) -> Any: ...
else:
def dump(value: _Marshallable, file: SupportsWrite[bytes], version: int = 4, /) -> None: ...
def load(file: SupportsRead[bytes], /) -> Any: ...
def dumps(value: _Marshallable, version: int = 4, /) -> bytes: ...
def loads(bytes: ReadableBuffer, /) -> Any: ...

View File

@ -123,3 +123,6 @@ def trunc(x: _SupportsTrunc[_T], /) -> _T: ...
if sys.version_info >= (3, 9):
def ulp(x: _SupportsFloatOrIndex, /) -> float: ...
if sys.version_info >= (3, 13):
def fma(x: _SupportsFloatOrIndex, y: _SupportsFloatOrIndex, z: _SupportsFloatOrIndex, /) -> float: ...

View File

@ -1,3 +1,4 @@
import sys
from _typeshed import StrPath
from collections.abc import Sequence
from typing import IO
@ -18,6 +19,9 @@ __all__ = [
"common_types",
]
if sys.version_info >= (3, 13):
__all__ += ["guess_file_type"]
def guess_type(url: StrPath, strict: bool = True) -> tuple[str | None, str | None]: ...
def guess_all_extensions(type: str, strict: bool = True) -> list[str]: ...
def guess_extension(type: str, strict: bool = True) -> str | None: ...
@ -25,6 +29,9 @@ def init(files: Sequence[str] | None = None) -> None: ...
def read_mime_types(file: str) -> dict[str, str] | None: ...
def add_type(type: str, ext: str, strict: bool = True) -> None: ...
if sys.version_info >= (3, 13):
def guess_file_type(path: StrPath, *, strict: bool = True) -> tuple[str | None, str | None]: ...
inited: bool
knownfiles: list[str]
suffix_map: dict[str, str]
@ -44,3 +51,5 @@ class MimeTypes:
def read(self, filename: str, strict: bool = True) -> None: ...
def readfp(self, fp: IO[str], strict: bool = True) -> None: ...
def read_windows_registry(self, strict: bool = True) -> None: ...
if sys.version_info >= (3, 13):
def guess_file_type(self, path: StrPath, *, strict: bool = True) -> tuple[str | None, str | None]: ...

View File

@ -76,6 +76,8 @@ class mmap(Iterable[int], Sized):
def __exit__(self, *args: Unused) -> None: ...
def __buffer__(self, flags: int, /) -> memoryview: ...
def __release_buffer__(self, buffer: memoryview, /) -> None: ...
if sys.version_info >= (3, 13):
def seekable(self) -> bool: ...
if sys.platform != "win32":
MADV_NORMAL: int

View File

@ -58,7 +58,7 @@ class ValueProxy(BaseProxy, Generic[_T]):
def set(self, value: _T) -> None: ...
value: _T
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
class DictProxy(BaseProxy, MutableMapping[_KT, _VT]):
__builtins__: ClassVar[dict[str, Any]]
@ -83,6 +83,8 @@ class DictProxy(BaseProxy, MutableMapping[_KT, _VT]):
def keys(self) -> list[_KT]: ... # type: ignore[override]
def items(self) -> list[tuple[_KT, _VT]]: ... # type: ignore[override]
def values(self) -> list[_VT]: ... # type: ignore[override]
if sys.version_info >= (3, 13):
def __class_getitem__(cls, args: Any, /) -> Any: ...
class BaseListProxy(BaseProxy, MutableSequence[_T]):
__builtins__: ClassVar[dict[str, Any]]
@ -117,6 +119,8 @@ class BaseListProxy(BaseProxy, MutableSequence[_T]):
class ListProxy(BaseListProxy[_T]):
def __iadd__(self, value: Iterable[_T], /) -> Self: ... # type: ignore[override]
def __imul__(self, value: SupportsIndex, /) -> Self: ... # type: ignore[override]
if sys.version_info >= (3, 13):
def __class_getitem__(cls, args: Any, /) -> Any: ...
# Returned by BaseManager.get_server()
class Server:

View File

@ -21,7 +21,7 @@ class ApplyResult(Generic[_T]):
def ready(self) -> bool: ...
def successful(self) -> bool: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
# alias created during issue #17805
AsyncResult = ApplyResult

View File

@ -38,4 +38,4 @@ class SimpleQueue(Generic[_T]):
def get(self) -> _T: ...
def put(self, obj: _T) -> None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

View File

@ -11,7 +11,11 @@ __all__ = ["SharedMemory", "ShareableList"]
_SLT = TypeVar("_SLT", int, float, bool, str, bytes, None)
class SharedMemory:
def __init__(self, name: str | None = None, create: bool = False, size: int = 0) -> None: ...
if sys.version_info >= (3, 13):
def __init__(self, name: str | None = None, create: bool = False, size: int = 0, *, track: bool = True) -> None: ...
else:
def __init__(self, name: str | None = None, create: bool = False, size: int = 0) -> None: ...
@property
def buf(self) -> memoryview: ...
@property
@ -37,4 +41,4 @@ class ShareableList(Generic[_SLT]):
def count(self, value: _SLT) -> int: ...
def index(self, value: _SLT) -> int: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

View File

@ -1,5 +1,5 @@
import sys
from _typeshed import BytesPath, StrPath
from _typeshed import BytesPath, StrOrBytesPath, StrPath
from genericpath import (
commonprefix as commonprefix,
exists as exists,
@ -47,6 +47,8 @@ from typing_extensions import LiteralString
if sys.version_info >= (3, 12):
from posixpath import isjunction as isjunction, splitroot as splitroot
if sys.version_info >= (3, 13):
from genericpath import isdevdrive as isdevdrive
__all__ = [
"normcase",
@ -90,6 +92,8 @@ __all__ = [
]
if sys.version_info >= (3, 12):
__all__ += ["isjunction", "splitroot"]
if sys.version_info >= (3, 13):
__all__ += ["isdevdrive", "isreserved"]
altsep: LiteralString
@ -117,3 +121,6 @@ if sys.platform == "win32":
else:
realpath = abspath
if sys.version_info >= (3, 13):
def isreserved(path: StrOrBytesPath) -> bool: ...

View File

@ -20,6 +20,8 @@ if sys.version_info >= (3, 12):
__all__ += ["hasarg", "hasexc"]
else:
__all__ += ["hasnargs"]
if sys.version_info >= (3, 13):
__all__ += ["hasjump"]
if sys.version_info >= (3, 9):
cmp_op: tuple[Literal["<"], Literal["<="], Literal["=="], Literal["!="], Literal[">"], Literal[">="]]
@ -50,10 +52,12 @@ if sys.version_info >= (3, 12):
hasexc: list[int]
else:
hasnargs: list[int]
if sys.version_info >= (3, 13):
hasjump: list[int]
opname: list[str]
opmap: dict[str, int]
HAVE_ARGUMENT: Literal[90]
EXTENDED_ARG: Literal[144]
HAVE_ARGUMENT: int
EXTENDED_ARG: int
def stack_effect(opcode: int, oparg: int | None = None, /, *, jump: bool | None = None) -> int: ...

View File

@ -151,7 +151,7 @@ class OptionContainer:
def _create_option_mappings(self) -> None: ...
def _share_option_mappings(self, parser: OptionParser) -> None: ...
@overload
def add_option(self, opt: Option) -> Option: ...
def add_option(self, opt: Option, /) -> Option: ...
@overload
def add_option(self, arg: str, /, *args: str | None, **kwargs) -> Option: ...
def add_options(self, option_list: Iterable[Option]) -> None: ...

View File

@ -437,7 +437,7 @@ class DirEntry(Generic[AnyStr]):
def stat(self, *, follow_symlinks: bool = True) -> stat_result: ...
def __fspath__(self) -> AnyStr: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
if sys.version_info >= (3, 12):
def is_junction(self) -> bool: ...

View File

@ -1,4 +1,5 @@
import sys
import types
from _typeshed import (
OpenBinaryMode,
OpenBinaryModeReading,
@ -14,7 +15,7 @@ from collections.abc import Callable, Generator, Iterator, Sequence
from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper
from os import PathLike, stat_result
from types import TracebackType
from typing import IO, Any, BinaryIO, Literal, overload
from typing import IO, Any, BinaryIO, ClassVar, Literal, overload
from typing_extensions import Self, deprecated
if sys.version_info >= (3, 9):
@ -22,7 +23,14 @@ if sys.version_info >= (3, 9):
__all__ = ["PurePath", "PurePosixPath", "PureWindowsPath", "Path", "PosixPath", "WindowsPath"]
if sys.version_info >= (3, 13):
__all__ += ["UnsupportedOperation"]
class PurePath(PathLike[str]):
if sys.version_info >= (3, 13):
parser: ClassVar[types.ModuleType]
def full_match(self, pattern: StrPath, *, case_sensitive: bool | None = None) -> bool: ...
@property
def parts(self) -> tuple[str, ...]: ...
@property
@ -94,8 +102,6 @@ class PureWindowsPath(PurePath): ...
class Path(PurePath):
def __new__(cls, *args: StrPath, **kwargs: Any) -> Self: ...
def __enter__(self) -> Self: ...
def __exit__(self, t: type[BaseException] | None, v: BaseException | None, tb: TracebackType | None) -> None: ...
@classmethod
def cwd(cls) -> Self: ...
if sys.version_info >= (3, 10):
@ -105,17 +111,38 @@ class Path(PurePath):
def stat(self) -> stat_result: ...
def chmod(self, mode: int) -> None: ...
if sys.version_info >= (3, 12):
def exists(self, *, follow_symlinks: bool = True) -> bool: ...
if sys.version_info >= (3, 13):
@classmethod
def from_uri(cls, uri: str) -> Path: ...
def is_dir(self, *, follow_symlinks: bool = True) -> bool: ...
def is_file(self, *, follow_symlinks: bool = True) -> bool: ...
def read_text(self, encoding: str | None = None, errors: str | None = None, newline: str | None = None) -> str: ...
else:
def __enter__(self) -> Self: ...
def __exit__(self, t: type[BaseException] | None, v: BaseException | None, tb: TracebackType | None) -> None: ...
def is_dir(self) -> bool: ...
def is_file(self) -> bool: ...
def read_text(self, encoding: str | None = None, errors: str | None = None) -> str: ...
if sys.version_info >= (3, 13):
def glob(
self, pattern: str, *, case_sensitive: bool | None = None, recurse_symlinks: bool = False
) -> Generator[Self, None, None]: ...
def rglob(
self, pattern: str, *, case_sensitive: bool | None = None, recurse_symlinks: bool = False
) -> Generator[Self, None, None]: ...
elif sys.version_info >= (3, 12):
def glob(self, pattern: str, *, case_sensitive: bool | None = None) -> Generator[Self, None, None]: ...
def rglob(self, pattern: str, *, case_sensitive: bool | None = None) -> Generator[Self, None, None]: ...
else:
def exists(self) -> bool: ...
def glob(self, pattern: str) -> Generator[Self, None, None]: ...
def rglob(self, pattern: str) -> Generator[Self, None, None]: ...
def is_dir(self) -> bool: ...
def is_file(self) -> bool: ...
if sys.version_info >= (3, 12):
def exists(self, *, follow_symlinks: bool = True) -> bool: ...
else:
def exists(self) -> bool: ...
def is_symlink(self) -> bool: ...
def is_socket(self) -> bool: ...
def is_fifo(self) -> bool: ...
@ -186,8 +213,12 @@ class Path(PurePath):
if sys.platform != "win32":
# These methods do "exist" on Windows, but they always raise NotImplementedError,
# so it's safer to pretend they don't exist
def owner(self) -> str: ...
def group(self) -> str: ...
if sys.version_info >= (3, 13):
def owner(self, *, follow_symlinks: bool = True) -> str: ...
def group(self, *, follow_symlinks: bool = True) -> str: ...
else:
def owner(self) -> str: ...
def group(self) -> str: ...
# This method does "exist" on Windows on <3.12, but always raises NotImplementedError
# On py312+, it works properly on Windows, as with all other platforms
@ -212,7 +243,6 @@ class Path(PurePath):
def absolute(self) -> Self: ...
def expanduser(self) -> Self: ...
def read_bytes(self) -> bytes: ...
def read_text(self, encoding: str | None = None, errors: str | None = None) -> str: ...
def samefile(self, other_path: StrPath) -> bool: ...
def write_bytes(self, data: ReadableBuffer) -> int: ...
if sys.version_info >= (3, 10):
@ -234,3 +264,6 @@ class Path(PurePath):
class PosixPath(Path, PurePosixPath): ...
class WindowsPath(Path, PureWindowsPath): ...
if sys.version_info >= (3, 13):
class UnsupportedOperation(NotImplementedError): ...

View File

@ -55,7 +55,9 @@ class Pdb(Bdb, Cmd):
) -> None: ...
def forget(self) -> None: ...
def setup(self, f: FrameType | None, tb: TracebackType | None) -> None: ...
def execRcLines(self) -> None: ...
if sys.version_info < (3, 11):
def execRcLines(self) -> None: ...
def bp_commands(self, frame: FrameType) -> bool: ...
def interaction(self, frame: FrameType | None, traceback: TracebackType | None) -> None: ...
def displayhook(self, obj: object) -> None: ...

View File

@ -40,3 +40,28 @@ def platform(aliased: bool = ..., terse: bool = ...) -> str: ...
if sys.version_info >= (3, 10):
def freedesktop_os_release() -> dict[str, str]: ...
if sys.version_info >= (3, 13):
class AndroidVer(NamedTuple):
release: str
api_level: int
manufacturer: str
model: str
device: str
is_emulator: bool
class IOSVersionInfo(NamedTuple):
system: str
release: str
model: str
is_simulator: bool
def android_ver(
release: str = "",
api_level: int = 0,
manufacturer: str = "",
model: str = "",
device: str = "",
is_emulator: bool = False,
) -> AndroidVer: ...
def ios_ver(system: str = "", release: str = "", model: str = "", is_simulator: bool = False) -> IOSVersionInfo: ...

View File

@ -14,6 +14,9 @@ from genericpath import (
sameopenfile as sameopenfile,
samestat as samestat,
)
if sys.version_info >= (3, 13):
from genericpath import isdevdrive as isdevdrive
from os import PathLike
from typing import AnyStr, overload
from typing_extensions import LiteralString
@ -60,6 +63,8 @@ __all__ = [
]
if sys.version_info >= (3, 12):
__all__ += ["isjunction", "splitroot"]
if sys.version_info >= (3, 13):
__all__ += ["isdevdrive"]
supports_unicode_filenames: bool
# aliases (also in os)

View File

@ -1,5 +1,5 @@
import sys
from _typeshed import OptExcInfo, SupportsWrite
from _typeshed import OptExcInfo, SupportsWrite, Unused
from abc import abstractmethod
from builtins import list as _list # "list" conflicts with method name
from collections.abc import Callable, Container, Mapping, MutableMapping
@ -121,7 +121,7 @@ class HTMLDoc(Doc):
def formattree(
self, tree: list[tuple[type, tuple[type, ...]] | list[Any]], modname: str, parent: type | None = None
) -> str: ...
def docmodule(self, object: object, name: str | None = None, mod: str | None = None, *ignored: Any) -> str: ...
def docmodule(self, object: object, name: str | None = None, mod: str | None = None, *ignored: Unused) -> str: ...
def docclass(
self,
object: object,
@ -129,22 +129,44 @@ class HTMLDoc(Doc):
mod: str | None = None,
funcs: Mapping[str, str] = {},
classes: Mapping[str, str] = {},
*ignored: Any,
*ignored: Unused,
) -> str: ...
def formatvalue(self, object: object) -> str: ...
def docroutine( # type: ignore[override]
self,
object: object,
name: str | None = None,
mod: str | None = None,
funcs: Mapping[str, str] = {},
classes: Mapping[str, str] = {},
methods: Mapping[str, str] = {},
cl: type | None = None,
) -> str: ...
def docproperty(self, object: object, name: str | None = None, mod: str | None = None, cl: Any | None = None) -> str: ... # type: ignore[override]
def docother(self, object: object, name: str | None = None, mod: Any | None = None, *ignored: Any) -> str: ...
def docdata(self, object: object, name: str | None = None, mod: Any | None = None, cl: Any | None = None) -> str: ... # type: ignore[override]
def docother(self, object: object, name: str | None = None, mod: Any | None = None, *ignored: Unused) -> str: ...
if sys.version_info >= (3, 11):
def docroutine( # type: ignore[override]
self,
object: object,
name: str | None = None,
mod: str | None = None,
funcs: Mapping[str, str] = {},
classes: Mapping[str, str] = {},
methods: Mapping[str, str] = {},
cl: type | None = None,
homecls: type | None = None,
) -> str: ...
def docproperty(
self, object: object, name: str | None = None, mod: str | None = None, cl: Any | None = None, *ignored: Unused
) -> str: ...
def docdata(
self, object: object, name: str | None = None, mod: Any | None = None, cl: Any | None = None, *ignored: Unused
) -> str: ...
else:
def docroutine( # type: ignore[override]
self,
object: object,
name: str | None = None,
mod: str | None = None,
funcs: Mapping[str, str] = {},
classes: Mapping[str, str] = {},
methods: Mapping[str, str] = {},
cl: type | None = None,
) -> str: ...
def docproperty(self, object: object, name: str | None = None, mod: str | None = None, cl: Any | None = None) -> str: ... # type: ignore[override]
def docdata(self, object: object, name: str | None = None, mod: Any | None = None, cl: Any | None = None) -> str: ... # type: ignore[override]
if sys.version_info >= (3, 11):
def parentlink(self, object: type | ModuleType, modname: str) -> str: ...
def index(self, dir: str, shadowed: MutableMapping[str, bool] | None = None) -> str: ...
def filelink(self, url: str, path: str) -> str: ...
@ -164,21 +186,48 @@ class TextDoc(Doc):
def formattree(
self, tree: list[tuple[type, tuple[type, ...]] | list[Any]], modname: str, parent: type | None = None, prefix: str = ""
) -> str: ...
def docmodule(self, object: object, name: str | None = None, mod: Any | None = None) -> str: ... # type: ignore[override]
def docclass(self, object: object, name: str | None = None, mod: str | None = None, *ignored: Any) -> str: ...
def docclass(self, object: object, name: str | None = None, mod: str | None = None, *ignored: Unused) -> str: ...
def formatvalue(self, object: object) -> str: ...
def docroutine(self, object: object, name: str | None = None, mod: str | None = None, cl: Any | None = None) -> str: ... # type: ignore[override]
def docproperty(self, object: object, name: str | None = None, mod: Any | None = None, cl: Any | None = None) -> str: ... # type: ignore[override]
def docdata(self, object: object, name: str | None = None, mod: str | None = None, cl: Any | None = None) -> str: ... # type: ignore[override]
def docother( # type: ignore[override]
self,
object: object,
name: str | None = None,
mod: str | None = None,
parent: str | None = None,
maxlen: int | None = None,
doc: Any | None = None,
) -> str: ...
if sys.version_info >= (3, 11):
def docroutine( # type: ignore[override]
self,
object: object,
name: str | None = None,
mod: str | None = None,
cl: Any | None = None,
homecls: Any | None = None,
) -> str: ...
def docmodule(self, object: object, name: str | None = None, mod: Any | None = None, *ignored: Unused) -> str: ...
def docproperty(
self, object: object, name: str | None = None, mod: Any | None = None, cl: Any | None = None, *ignored: Unused
) -> str: ...
def docdata(
self, object: object, name: str | None = None, mod: str | None = None, cl: Any | None = None, *ignored: Unused
) -> str: ...
def docother(
self,
object: object,
name: str | None = None,
mod: str | None = None,
parent: str | None = None,
*ignored: Unused,
maxlen: int | None = None,
doc: Any | None = None,
) -> str: ...
else:
def docroutine(self, object: object, name: str | None = None, mod: str | None = None, cl: Any | None = None) -> str: ... # type: ignore[override]
def docmodule(self, object: object, name: str | None = None, mod: Any | None = None) -> str: ... # type: ignore[override]
def docproperty(self, object: object, name: str | None = None, mod: Any | None = None, cl: Any | None = None) -> str: ... # type: ignore[override]
def docdata(self, object: object, name: str | None = None, mod: str | None = None, cl: Any | None = None) -> str: ... # type: ignore[override]
def docother( # type: ignore[override]
self,
object: object,
name: str | None = None,
mod: str | None = None,
parent: str | None = None,
maxlen: int | None = None,
doc: Any | None = None,
) -> str: ...
def pager(text: str) -> None: ...
def getpager() -> Callable[[str], None]: ...

View File

@ -6,6 +6,8 @@ if sys.version_info >= (3, 9):
from types import GenericAlias
__all__ = ["Empty", "Full", "Queue", "PriorityQueue", "LifoQueue", "SimpleQueue"]
if sys.version_info >= (3, 13):
__all__ += ["ShutDown"]
_T = TypeVar("_T")
@ -46,7 +48,7 @@ class Queue(Generic[_T]):
def _qsize(self) -> int: ...
def task_done(self) -> None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
class PriorityQueue(Queue[_T]):
queue: list[_T]
@ -63,4 +65,4 @@ class SimpleQueue(Generic[_T]):
def put_nowait(self, item: _T) -> None: ...
def qsize(self) -> int: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

View File

@ -41,7 +41,10 @@ _T = TypeVar("_T")
class Random(_random.Random):
VERSION: ClassVar[int]
def __init__(self, x: Any = None) -> None: ...
if sys.version_info >= (3, 9):
def __init__(self, x: int | float | str | bytes | bytearray | None = None) -> None: ... # noqa: Y041
else:
def __init__(self, x: Any = None) -> None: ...
# Using other `seed` types is deprecated since 3.9 and removed in 3.11
# Ignore Y041, since random.seed doesn't treat int like a float subtype. Having an explicit
# int better documents conventional usage of random.seed.

View File

@ -1,5 +1,6 @@
import enum
import sre_compile
import sre_constants
import sys
from _typeshed import ReadableBuffer
from collections.abc import Callable, Iterator, Mapping
@ -21,7 +22,6 @@ __all__ = [
"finditer",
"compile",
"purge",
"template",
"escape",
"error",
"A",
@ -41,10 +41,17 @@ __all__ = [
"Match",
"Pattern",
]
if sys.version_info < (3, 13):
__all__ += ["template"]
if sys.version_info >= (3, 11):
__all__ += ["NOFLAG", "RegexFlag"]
if sys.version_info >= (3, 13):
__all__ += ["PatternError"]
PatternError = sre_constants.error
_T = TypeVar("_T")
@final
@ -102,7 +109,7 @@ class Match(Generic[AnyStr]):
def __copy__(self) -> Match[AnyStr]: ...
def __deepcopy__(self, memo: Any, /) -> Match[AnyStr]: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
@final
class Pattern(Generic[AnyStr]):
@ -178,7 +185,7 @@ class Pattern(Generic[AnyStr]):
def __eq__(self, value: object, /) -> bool: ...
def __hash__(self) -> int: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
# ----- re variables and constants -----
@ -198,10 +205,11 @@ class RegexFlag(enum.IntFlag):
VERBOSE = X
U = sre_compile.SRE_FLAG_UNICODE
UNICODE = U
T = sre_compile.SRE_FLAG_TEMPLATE
TEMPLATE = T
if sys.version_info < (3, 13):
T = sre_compile.SRE_FLAG_TEMPLATE
TEMPLATE = T
if sys.version_info >= (3, 11):
NOFLAG: int
NOFLAG = 0
A = RegexFlag.A
ASCII = RegexFlag.ASCII
@ -218,8 +226,9 @@ X = RegexFlag.X
VERBOSE = RegexFlag.VERBOSE
U = RegexFlag.U
UNICODE = RegexFlag.UNICODE
T = RegexFlag.T
TEMPLATE = RegexFlag.TEMPLATE
if sys.version_info < (3, 13):
T = RegexFlag.T
TEMPLATE = RegexFlag.TEMPLATE
if sys.version_info >= (3, 11):
NOFLAG = RegexFlag.NOFLAG
_FlagsType: TypeAlias = int | RegexFlag
@ -287,4 +296,6 @@ def subn(
) -> tuple[bytes, int]: ...
def escape(pattern: AnyStr) -> AnyStr: ...
def purge() -> None: ...
def template(pattern: AnyStr | Pattern[AnyStr], flags: _FlagsType = 0) -> Pattern[AnyStr]: ...
if sys.version_info < (3, 13):
def template(pattern: AnyStr | Pattern[AnyStr], flags: _FlagsType = 0) -> Pattern[AnyStr]: ...

View File

@ -1,6 +1,6 @@
import os
import sys
from _typeshed import BytesPath, FileDescriptorOrPath, StrOrBytesPath, StrPath, SupportsRead, SupportsWrite
from _typeshed import BytesPath, ExcInfo, FileDescriptorOrPath, StrOrBytesPath, StrPath, SupportsRead, SupportsWrite
from collections.abc import Callable, Iterable, Sequence
from tarfile import _TarfileFilter
from typing import Any, AnyStr, NamedTuple, Protocol, TypeVar, overload
@ -71,14 +71,12 @@ def copytree(
dirs_exist_ok: bool = False,
) -> _PathReturn: ...
_OnErrorCallback: TypeAlias = Callable[[Callable[..., Any], str, Any], object]
_OnExcCallback: TypeAlias = Callable[[Callable[..., Any], str, Exception], object]
_OnErrorCallback: TypeAlias = Callable[[Callable[..., Any], str, ExcInfo], object]
_OnExcCallback: TypeAlias = Callable[[Callable[..., Any], str, BaseException], object]
class _RmtreeType(Protocol):
avoids_symlink_attacks: bool
if sys.version_info >= (3, 12):
@overload
def __call__(self, path: StrOrBytesPath, ignore_errors: bool = False, *, dir_fd: int | None = None) -> None: ...
@overload
@deprecated("The `onerror` parameter is deprecated and will be removed in Python 3.14. Use `onexc` instead.")
def __call__(
@ -91,7 +89,12 @@ class _RmtreeType(Protocol):
) -> None: ...
@overload
def __call__(
self, path: StrOrBytesPath, ignore_errors: bool = False, *, onexc: _OnExcCallback, dir_fd: int | None = None
self,
path: StrOrBytesPath,
ignore_errors: bool = False,
*,
onexc: _OnExcCallback | None = None,
dir_fd: int | None = None,
) -> None: ...
elif sys.version_info >= (3, 11):
def __call__(
@ -132,14 +135,44 @@ def disk_usage(path: FileDescriptorOrPath) -> _ntuple_diskusage: ...
# While chown can be imported on Windows, it doesn't actually work;
# see https://bugs.python.org/issue33140. We keep it here because it's
# in __all__.
@overload
def chown(path: FileDescriptorOrPath, user: str | int, group: None = None) -> None: ...
@overload
def chown(path: FileDescriptorOrPath, user: None = None, *, group: str | int) -> None: ...
@overload
def chown(path: FileDescriptorOrPath, user: None, group: str | int) -> None: ...
@overload
def chown(path: FileDescriptorOrPath, user: str | int, group: str | int) -> None: ...
if sys.version_info >= (3, 13):
@overload
def chown(
path: FileDescriptorOrPath,
user: str | int,
group: None = None,
*,
dir_fd: int | None = None,
follow_symlinks: bool = True,
) -> None: ...
@overload
def chown(
path: FileDescriptorOrPath,
user: None = None,
*,
group: str | int,
dir_fd: int | None = None,
follow_symlinks: bool = True,
) -> None: ...
@overload
def chown(
path: FileDescriptorOrPath, user: None, group: str | int, *, dir_fd: int | None = None, follow_symlinks: bool = True
) -> None: ...
@overload
def chown(
path: FileDescriptorOrPath, user: str | int, group: str | int, *, dir_fd: int | None = None, follow_symlinks: bool = True
) -> None: ...
else:
@overload
def chown(path: FileDescriptorOrPath, user: str | int, group: None = None) -> None: ...
@overload
def chown(path: FileDescriptorOrPath, user: None = None, *, group: str | int) -> None: ...
@overload
def chown(path: FileDescriptorOrPath, user: None, group: str | int) -> None: ...
@overload
def chown(path: FileDescriptorOrPath, user: str | int, group: str | int) -> None: ...
@overload
def which(cmd: _StrPathT, mode: int = 1, path: StrPath | None = None) -> str | _StrPathT | None: ...
@overload

View File

@ -181,7 +181,7 @@ else:
def strsignal(signalnum: _SIGNUM, /) -> str | None: ...
def valid_signals() -> set[Signals]: ...
def raise_signal(signalnum: _SIGNUM, /) -> None: ...
def set_wakeup_fd(fd: int, *, warn_on_full_buffer: bool = ...) -> int: ...
def set_wakeup_fd(fd: int, /, *, warn_on_full_buffer: bool = ...) -> int: ...
if sys.version_info >= (3, 9):
if sys.platform == "linux":

View File

@ -428,7 +428,11 @@ class Connection:
def executemany(self, sql: str, parameters: Iterable[_Parameters], /) -> Cursor: ...
def executescript(self, sql_script: str, /) -> Cursor: ...
def interrupt(self) -> None: ...
def iterdump(self) -> Generator[str, None, None]: ...
if sys.version_info >= (3, 13):
def iterdump(self, *, filter: str | None = None) -> Generator[str, None, None]: ...
else:
def iterdump(self) -> Generator[str, None, None]: ...
def rollback(self) -> None: ...
def set_authorizer(
self, authorizer_callback: Callable[[int, str | None, str | None, str | None, str | None], int] | None

View File

@ -1 +1,7 @@
import sys
from _stat import *
from typing import Literal
if sys.version_info >= (3, 13):
# https://github.com/python/cpython/issues/114081#issuecomment-2119017790
SF_RESTRICTED: Literal[0x00080000]

View File

@ -1,6 +1,6 @@
import sys
from _typeshed import SupportsRichComparisonT
from collections.abc import Hashable, Iterable, Sequence
from collections.abc import Callable, Hashable, Iterable, Sequence
from decimal import Decimal
from fractions import Fraction
from typing import Any, Literal, NamedTuple, SupportsFloat, TypeVar
@ -28,6 +28,8 @@ __all__ = [
if sys.version_info >= (3, 10):
__all__ += ["covariance", "correlation", "linear_regression"]
if sys.version_info >= (3, 13):
__all__ += ["kde", "kde_random"]
# Most functions in this module accept homogeneous collections of one of these types
_Number: TypeAlias = float | Decimal | Fraction
@ -130,3 +132,30 @@ if sys.version_info >= (3, 11):
elif sys.version_info >= (3, 10):
def linear_regression(regressor: Sequence[_Number], dependent_variable: Sequence[_Number], /) -> LinearRegression: ...
if sys.version_info >= (3, 13):
_Kernel: TypeAlias = Literal[
"normal",
"gauss",
"logistic",
"sigmoid",
"rectangular",
"uniform",
"triangular",
"parabolic",
"epanechnikov",
"quartic",
"biweight",
"triweight",
"cosine",
]
def kde(
data: Sequence[float], h: float, kernel: _Kernel = "normal", *, cumulative: bool = False
) -> Callable[[float], float]: ...
def kde_random(
data: Sequence[float],
h: float,
kernel: _Kernel = "normal",
*,
seed: int | float | str | bytes | bytearray | None = None, # noqa: Y041
) -> Callable[[], float]: ...

View File

@ -88,7 +88,7 @@ class CompletedProcess(Generic[_T]):
def __init__(self, args: _CMD, returncode: int, stdout: _T | None = None, stderr: _T | None = None) -> None: ...
def check_returncode(self) -> None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
if sys.version_info >= (3, 11):
# 3.11 adds "process_group" argument
@ -2560,7 +2560,7 @@ class Popen(Generic[AnyStr]):
) -> None: ...
def __del__(self) -> None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
# The result really is always a str.
if sys.version_info >= (3, 11):

View File

@ -1,5 +1,5 @@
import sys
from _typeshed import OptExcInfo, ProfileFunction, TraceFunction, structseq
from _typeshed import MaybeNone, OptExcInfo, ProfileFunction, TraceFunction, structseq
from _typeshed.importlib import MetaPathFinderProtocol, PathEntryFinderProtocol
from builtins import object as _object
from collections.abc import AsyncGenerator, Callable, Sequence
@ -56,23 +56,24 @@ ps2: object
# TextIO is used instead of more specific types for the standard streams,
# since they are often monkeypatched at runtime. At startup, the objects
# are initialized to instances of TextIOWrapper.
# are initialized to instances of TextIOWrapper, but can also be None under
# some circumstances.
#
# To use methods from TextIOWrapper, use an isinstance check to ensure that
# the streams have not been overridden:
#
# if isinstance(sys.stdout, io.TextIOWrapper):
# sys.stdout.reconfigure(...)
stdin: TextIO
stdout: TextIO
stderr: TextIO
stdin: TextIO | MaybeNone
stdout: TextIO | MaybeNone
stderr: TextIO | MaybeNone
if sys.version_info >= (3, 10):
stdlib_module_names: frozenset[str]
__stdin__: Final[TextIOWrapper] # Contains the original value of stdin
__stdout__: Final[TextIOWrapper] # Contains the original value of stdout
__stderr__: Final[TextIOWrapper] # Contains the original value of stderr
__stdin__: Final[TextIOWrapper | None] # Contains the original value of stdin
__stdout__: Final[TextIOWrapper | None] # Contains the original value of stdout
__stderr__: Final[TextIOWrapper | None] # Contains the original value of stderr
tracebacklimit: int
version: str
api_version: int
@ -264,9 +265,9 @@ def getrecursionlimit() -> int: ...
def getsizeof(obj: object, default: int = ...) -> int: ...
def getswitchinterval() -> float: ...
def getprofile() -> ProfileFunction | None: ...
def setprofile(profilefunc: ProfileFunction | None) -> None: ...
def setprofile(function: ProfileFunction | None, /) -> None: ...
def gettrace() -> TraceFunction | None: ...
def settrace(tracefunc: TraceFunction | None) -> None: ...
def settrace(function: TraceFunction | None, /) -> None: ...
if sys.platform == "win32":
# A tuple of length 5, even though it has more than 5 attributes.

View File

@ -35,6 +35,15 @@ if sys.platform != "win32":
LOG_USER: Literal[8]
LOG_UUCP: Literal[64]
LOG_WARNING: Literal[4]
if sys.version_info >= (3, 13):
LOG_FTP: Literal[88]
LOG_INSTALL: Literal[112]
LOG_LAUNCHD: Literal[192]
LOG_NETINFO: Literal[96]
LOG_RAS: Literal[120]
LOG_REMOTEAUTH: Literal[104]
def LOG_MASK(pri: int, /) -> int: ...
def LOG_UPTO(pri: int, /) -> int: ...
def closelog() -> None: ...

View File

@ -142,22 +142,43 @@ class TarFile:
errorlevel: int | None
offset: int # undocumented
extraction_filter: _FilterFunction | None
def __init__(
self,
name: StrOrBytesPath | None = None,
mode: Literal["r", "a", "w", "x"] = "r",
fileobj: _Fileobj | None = None,
format: int | None = None,
tarinfo: type[TarInfo] | None = None,
dereference: bool | None = None,
ignore_zeros: bool | None = None,
encoding: str | None = None,
errors: str = "surrogateescape",
pax_headers: Mapping[str, str] | None = None,
debug: int | None = None,
errorlevel: int | None = None,
copybufsize: int | None = None, # undocumented
) -> None: ...
if sys.version_info >= (3, 13):
stream: bool
def __init__(
self,
name: StrOrBytesPath | None = None,
mode: Literal["r", "a", "w", "x"] = "r",
fileobj: _Fileobj | None = None,
format: int | None = None,
tarinfo: type[TarInfo] | None = None,
dereference: bool | None = None,
ignore_zeros: bool | None = None,
encoding: str | None = None,
errors: str = "surrogateescape",
pax_headers: Mapping[str, str] | None = None,
debug: int | None = None,
errorlevel: int | None = None,
copybufsize: int | None = None, # undocumented
stream: bool = False,
) -> None: ...
else:
def __init__(
self,
name: StrOrBytesPath | None = None,
mode: Literal["r", "a", "w", "x"] = "r",
fileobj: _Fileobj | None = None,
format: int | None = None,
tarinfo: type[TarInfo] | None = None,
dereference: bool | None = None,
ignore_zeros: bool | None = None,
encoding: str | None = None,
errors: str = "surrogateescape",
pax_headers: Mapping[str, str] | None = None,
debug: int | None = None,
errorlevel: int | None = None,
copybufsize: int | None = None, # undocumented
) -> None: ...
def __enter__(self) -> Self: ...
def __exit__(
self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None

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