mirror of https://github.com/astral-sh/ruff
Sync vendored typeshed stubs (#16173)
Close and reopen this PR to trigger CI Co-authored-by: typeshedbot <>
This commit is contained in:
parent
977447f9b8
commit
171facd960
|
|
@ -1 +1 @@
|
||||||
c193cd2a36839c8e6336f350397f51ce52fedd5e
|
cc8ca939c0477a49fcce0554fa1743bd5c656a11
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ if sys.platform == "win32":
|
||||||
SO_EXCLUSIVEADDRUSE: int
|
SO_EXCLUSIVEADDRUSE: int
|
||||||
if sys.platform != "win32":
|
if sys.platform != "win32":
|
||||||
SO_REUSEPORT: int
|
SO_REUSEPORT: int
|
||||||
if sys.platform != "darwin" or sys.version_info >= (3, 13):
|
if sys.platform != "darwin":
|
||||||
SO_BINDTODEVICE: int
|
SO_BINDTODEVICE: int
|
||||||
|
|
||||||
if sys.platform != "win32" and sys.platform != "darwin":
|
if sys.platform != "win32" and sys.platform != "darwin":
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import sys
|
||||||
from _typeshed import SupportsWrite, sentinel
|
from _typeshed import SupportsWrite, sentinel
|
||||||
from collections.abc import Callable, Generator, Iterable, Sequence
|
from collections.abc import Callable, Generator, Iterable, Sequence
|
||||||
from re import Pattern
|
from re import Pattern
|
||||||
from typing import IO, Any, ClassVar, Final, Generic, NewType, NoReturn, Protocol, TypeVar, overload
|
from typing import IO, Any, ClassVar, Final, Generic, NoReturn, Protocol, TypeVar, overload
|
||||||
from typing_extensions import Self, TypeAlias, deprecated
|
from typing_extensions import Self, TypeAlias, deprecated
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
|
|
@ -33,25 +33,14 @@ _ActionT = TypeVar("_ActionT", bound=Action)
|
||||||
_ArgumentParserT = TypeVar("_ArgumentParserT", bound=ArgumentParser)
|
_ArgumentParserT = TypeVar("_ArgumentParserT", bound=ArgumentParser)
|
||||||
_N = TypeVar("_N")
|
_N = TypeVar("_N")
|
||||||
_ActionType: TypeAlias = Callable[[str], Any] | FileType | str
|
_ActionType: TypeAlias = Callable[[str], Any] | FileType | str
|
||||||
# more precisely, Literal["store", "store_const", "store_true",
|
|
||||||
# "store_false", "append", "append_const", "count", "help", "version",
|
|
||||||
# "extend"], but using this would make it hard to annotate callers
|
|
||||||
# that don't use a literal argument
|
|
||||||
_ActionStr: TypeAlias = str
|
|
||||||
# more precisely, Literal["?", "*", "+", "...", "A...",
|
|
||||||
# "==SUPPRESS=="], but using this would make it hard to annotate
|
|
||||||
# callers that don't use a literal argument
|
|
||||||
_NArgsStr: TypeAlias = str
|
|
||||||
|
|
||||||
ONE_OR_MORE: Final = "+"
|
ONE_OR_MORE: Final = "+"
|
||||||
OPTIONAL: Final = "?"
|
OPTIONAL: Final = "?"
|
||||||
PARSER: Final = "A..."
|
PARSER: Final = "A..."
|
||||||
REMAINDER: Final = "..."
|
REMAINDER: Final = "..."
|
||||||
_SUPPRESS_T = NewType("_SUPPRESS_T", str)
|
SUPPRESS: Final = "==SUPPRESS=="
|
||||||
SUPPRESS: _SUPPRESS_T | str # not using Literal because argparse sometimes compares SUPPRESS with is
|
|
||||||
# the | str is there so that foo = argparse.SUPPRESS; foo = "test" checks out in mypy
|
|
||||||
ZERO_OR_MORE: Final = "*"
|
ZERO_OR_MORE: Final = "*"
|
||||||
_UNRECOGNIZED_ARGS_ATTR: Final[str] # undocumented
|
_UNRECOGNIZED_ARGS_ATTR: Final = "_unrecognized_args" # undocumented
|
||||||
|
|
||||||
class ArgumentError(Exception):
|
class ArgumentError(Exception):
|
||||||
argument_name: str | None
|
argument_name: str | None
|
||||||
|
|
@ -86,8 +75,13 @@ class _ActionsContainer:
|
||||||
def add_argument(
|
def add_argument(
|
||||||
self,
|
self,
|
||||||
*name_or_flags: str,
|
*name_or_flags: str,
|
||||||
action: _ActionStr | type[Action] = ...,
|
# str covers predefined actions ("store_true", "count", etc.)
|
||||||
nargs: int | _NArgsStr | _SUPPRESS_T | None = None,
|
# and user registered actions via the `register` method.
|
||||||
|
action: str | type[Action] = ...,
|
||||||
|
# more precisely, Literal["?", "*", "+", "...", "A...", "==SUPPRESS=="],
|
||||||
|
# but using this would make it hard to annotate callers that don't use a
|
||||||
|
# literal argument and for subclasses to override this method.
|
||||||
|
nargs: int | str | None = None,
|
||||||
const: Any = ...,
|
const: Any = ...,
|
||||||
default: Any = ...,
|
default: Any = ...,
|
||||||
type: _ActionType = ...,
|
type: _ActionType = ...,
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,7 @@ if sys.version_info >= (3, 12):
|
||||||
_FutureLike: TypeAlias = Future[_T] | Awaitable[_T]
|
_FutureLike: TypeAlias = Future[_T] | Awaitable[_T]
|
||||||
else:
|
else:
|
||||||
_FutureLike: TypeAlias = Future[_T] | Generator[Any, None, _T] | Awaitable[_T]
|
_FutureLike: TypeAlias = Future[_T] | Generator[Any, None, _T] | Awaitable[_T]
|
||||||
|
|
||||||
_TaskYieldType: TypeAlias = Future[object] | None
|
_TaskYieldType: TypeAlias = Future[object] | None
|
||||||
|
|
||||||
FIRST_COMPLETED = concurrent.futures.FIRST_COMPLETED
|
FIRST_COMPLETED = concurrent.futures.FIRST_COMPLETED
|
||||||
|
|
@ -347,7 +348,8 @@ else:
|
||||||
*coros_or_futures: _FutureLike[_T], loop: AbstractEventLoop | None = None, return_exceptions: bool
|
*coros_or_futures: _FutureLike[_T], loop: AbstractEventLoop | None = None, return_exceptions: bool
|
||||||
) -> Future[list[_T | BaseException]]: ...
|
) -> Future[list[_T | BaseException]]: ...
|
||||||
|
|
||||||
def run_coroutine_threadsafe(coro: _FutureLike[_T], loop: AbstractEventLoop) -> concurrent.futures.Future[_T]: ...
|
# unlike some asyncio apis, This does strict runtime checking of actually being a coroutine, not of any future-like.
|
||||||
|
def run_coroutine_threadsafe(coro: Coroutine[Any, Any, _T], loop: AbstractEventLoop) -> concurrent.futures.Future[_T]: ...
|
||||||
|
|
||||||
if sys.version_info >= (3, 10):
|
if sys.version_info >= (3, 10):
|
||||||
def shield(arg: _FutureLike[_T]) -> Future[_T]: ...
|
def shield(arg: _FutureLike[_T]) -> Future[_T]: ...
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import sys
|
import sys
|
||||||
from _typeshed import ExcInfo, TraceFunction, Unused
|
from _typeshed import ExcInfo, TraceFunction, Unused
|
||||||
from collections.abc import Callable, Iterable, Mapping
|
from collections.abc import Callable, Iterable, Iterator, Mapping
|
||||||
|
from contextlib import contextmanager
|
||||||
from types import CodeType, FrameType, TracebackType
|
from types import CodeType, FrameType, TracebackType
|
||||||
from typing import IO, Any, Final, SupportsInt, TypeVar
|
from typing import IO, Any, Final, SupportsInt, TypeVar
|
||||||
from typing_extensions import ParamSpec
|
from typing_extensions import ParamSpec
|
||||||
|
|
@ -30,6 +31,10 @@ class Bdb:
|
||||||
def __init__(self, skip: Iterable[str] | None = None) -> None: ...
|
def __init__(self, skip: Iterable[str] | None = None) -> None: ...
|
||||||
def canonic(self, filename: str) -> str: ...
|
def canonic(self, filename: str) -> str: ...
|
||||||
def reset(self) -> None: ...
|
def reset(self) -> None: ...
|
||||||
|
if sys.version_info >= (3, 12):
|
||||||
|
@contextmanager
|
||||||
|
def set_enterframe(self, frame: FrameType) -> Iterator[None]: ...
|
||||||
|
|
||||||
def trace_dispatch(self, frame: FrameType, event: str, arg: Any) -> TraceFunction: ...
|
def trace_dispatch(self, frame: FrameType, event: str, arg: Any) -> TraceFunction: ...
|
||||||
def dispatch_line(self, frame: FrameType) -> TraceFunction: ...
|
def dispatch_line(self, frame: FrameType) -> TraceFunction: ...
|
||||||
def dispatch_call(self, frame: FrameType, arg: None) -> TraceFunction: ...
|
def dispatch_call(self, frame: FrameType, arg: None) -> TraceFunction: ...
|
||||||
|
|
@ -73,7 +78,7 @@ class Bdb:
|
||||||
def get_file_breaks(self, filename: str) -> list[Breakpoint]: ...
|
def get_file_breaks(self, filename: str) -> list[Breakpoint]: ...
|
||||||
def get_all_breaks(self) -> list[Breakpoint]: ...
|
def get_all_breaks(self) -> list[Breakpoint]: ...
|
||||||
def get_stack(self, f: FrameType | None, t: TracebackType | None) -> tuple[list[tuple[FrameType, int]], int]: ...
|
def get_stack(self, f: FrameType | None, t: TracebackType | None) -> tuple[list[tuple[FrameType, int]], int]: ...
|
||||||
def format_stack_entry(self, frame_lineno: int, lprefix: str = ": ") -> str: ...
|
def format_stack_entry(self, frame_lineno: tuple[FrameType, int], lprefix: str = ": ") -> str: ...
|
||||||
def run(
|
def run(
|
||||||
self, cmd: str | CodeType, globals: dict[str, Any] | None = None, locals: Mapping[str, Any] | None = None
|
self, cmd: str | CodeType, globals: dict[str, Any] | None = None, locals: Mapping[str, Any] | None = None
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
|
|
||||||
|
|
@ -1295,7 +1295,7 @@ def ascii(obj: object, /) -> str: ...
|
||||||
def bin(number: int | SupportsIndex, /) -> str: ...
|
def bin(number: int | SupportsIndex, /) -> str: ...
|
||||||
def breakpoint(*args: Any, **kws: Any) -> None: ...
|
def breakpoint(*args: Any, **kws: Any) -> None: ...
|
||||||
def callable(obj: object, /) -> TypeIs[Callable[..., object]]: ...
|
def callable(obj: object, /) -> TypeIs[Callable[..., object]]: ...
|
||||||
def chr(i: int, /) -> str: ...
|
def chr(i: int | SupportsIndex, /) -> str: ...
|
||||||
|
|
||||||
# We define this here instead of using os.PathLike to avoid import cycle issues.
|
# We define this here instead of using os.PathLike to avoid import cycle issues.
|
||||||
# See https://github.com/python/typeshed/pull/991#issuecomment-288160993
|
# See https://github.com/python/typeshed/pull/991#issuecomment-288160993
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,9 @@ _T = TypeVar("_T")
|
||||||
_T_co = TypeVar("_T_co", covariant=True)
|
_T_co = TypeVar("_T_co", covariant=True)
|
||||||
_T_io = TypeVar("_T_io", bound=IO[str] | None)
|
_T_io = TypeVar("_T_io", bound=IO[str] | None)
|
||||||
_ExitT_co = TypeVar("_ExitT_co", covariant=True, bound=bool | None, default=bool | None)
|
_ExitT_co = TypeVar("_ExitT_co", covariant=True, bound=bool | None, default=bool | None)
|
||||||
|
_F = TypeVar("_F", bound=Callable[..., Any])
|
||||||
_G = TypeVar("_G", bound=Generator[Any, Any, Any] | AsyncGenerator[Any, Any], covariant=True)
|
_G = TypeVar("_G", bound=Generator[Any, Any, Any] | AsyncGenerator[Any, Any], covariant=True)
|
||||||
_P = ParamSpec("_P")
|
_P = ParamSpec("_P")
|
||||||
_R = TypeVar("_R")
|
|
||||||
|
|
||||||
_SendT_contra = TypeVar("_SendT_contra", contravariant=True, default=None)
|
_SendT_contra = TypeVar("_SendT_contra", contravariant=True, default=None)
|
||||||
_ReturnT_co = TypeVar("_ReturnT_co", covariant=True, default=None)
|
_ReturnT_co = TypeVar("_ReturnT_co", covariant=True, default=None)
|
||||||
|
|
@ -64,13 +64,9 @@ class AbstractAsyncContextManager(ABC, Protocol[_T_co, _ExitT_co]): # type: ign
|
||||||
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, /
|
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, /
|
||||||
) -> _ExitT_co: ...
|
) -> _ExitT_co: ...
|
||||||
|
|
||||||
class _WrappedCallable(Generic[_P, _R]):
|
|
||||||
__wrapped__: Callable[_P, _R]
|
|
||||||
def __call__(self, *args: _P.args, **kwargs: _P.kwargs) -> _R: ...
|
|
||||||
|
|
||||||
class ContextDecorator:
|
class ContextDecorator:
|
||||||
def _recreate_cm(self) -> Self: ...
|
def _recreate_cm(self) -> Self: ...
|
||||||
def __call__(self, func: Callable[_P, _R]) -> _WrappedCallable[_P, _R]: ...
|
def __call__(self, func: _F) -> _F: ...
|
||||||
|
|
||||||
class _GeneratorContextManagerBase(Generic[_G]):
|
class _GeneratorContextManagerBase(Generic[_G]):
|
||||||
# Ideally this would use ParamSpec, but that requires (*args, **kwargs), which this isn't. see #6676
|
# Ideally this would use ParamSpec, but that requires (*args, **kwargs), which this isn't. see #6676
|
||||||
|
|
@ -97,11 +93,11 @@ class _GeneratorContextManager(
|
||||||
def contextmanager(func: Callable[_P, Iterator[_T_co]]) -> Callable[_P, _GeneratorContextManager[_T_co]]: ...
|
def contextmanager(func: Callable[_P, Iterator[_T_co]]) -> Callable[_P, _GeneratorContextManager[_T_co]]: ...
|
||||||
|
|
||||||
if sys.version_info >= (3, 10):
|
if sys.version_info >= (3, 10):
|
||||||
_AR = TypeVar("_AR", bound=Awaitable[Any])
|
_AF = TypeVar("_AF", bound=Callable[..., Awaitable[Any]])
|
||||||
|
|
||||||
class AsyncContextDecorator:
|
class AsyncContextDecorator:
|
||||||
def _recreate_cm(self) -> Self: ...
|
def _recreate_cm(self) -> Self: ...
|
||||||
def __call__(self, func: Callable[_P, _AR]) -> _WrappedCallable[_P, _AR]: ...
|
def __call__(self, func: _AF) -> _AF: ...
|
||||||
|
|
||||||
class _AsyncGeneratorContextManager(
|
class _AsyncGeneratorContextManager(
|
||||||
_GeneratorContextManagerBase[AsyncGenerator[_T_co, _SendT_contra]],
|
_GeneratorContextManagerBase[AsyncGenerator[_T_co, _SendT_contra]],
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import sys
|
||||||
from collections.abc import Iterable, Iterator
|
from collections.abc import Iterable, Iterator
|
||||||
from email.errors import HeaderParseError, MessageDefect
|
from email.errors import HeaderParseError, MessageDefect
|
||||||
from email.policy import Policy
|
from email.policy import Policy
|
||||||
|
|
@ -21,6 +22,9 @@ NLSET: Final[set[str]]
|
||||||
# Added in Python 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.5
|
# Added in Python 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.5
|
||||||
SPECIALSNL: Final[set[str]]
|
SPECIALSNL: Final[set[str]]
|
||||||
|
|
||||||
|
if sys.version_info >= (3, 12):
|
||||||
|
def make_quoted_pairs(value: Any) -> str: ...
|
||||||
|
|
||||||
def quote_string(value: Any) -> str: ...
|
def quote_string(value: Any) -> str: ...
|
||||||
|
|
||||||
rfc2047_matcher: Pattern[str]
|
rfc2047_matcher: Pattern[str]
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,11 @@ if sys.version_info >= (3, 11):
|
||||||
def __init__(self, value: _EnumMemberT) -> None: ...
|
def __init__(self, value: _EnumMemberT) -> None: ...
|
||||||
|
|
||||||
class _EnumDict(dict[str, Any]):
|
class _EnumDict(dict[str, Any]):
|
||||||
|
if sys.version_info >= (3, 13):
|
||||||
|
def __init__(self, cls_name: str | None = None) -> None: ...
|
||||||
|
else:
|
||||||
def __init__(self) -> None: ...
|
def __init__(self) -> None: ...
|
||||||
|
|
||||||
def __setitem__(self, key: str, value: Any) -> None: ...
|
def __setitem__(self, key: str, value: Any) -> None: ...
|
||||||
if sys.version_info >= (3, 11):
|
if sys.version_info >= (3, 11):
|
||||||
# See comment above `typing.MutableMapping.update`
|
# See comment above `typing.MutableMapping.update`
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
|
||||||
client_address: _socket._RetAddress,
|
client_address: _socket._RetAddress,
|
||||||
server: socketserver.BaseServer,
|
server: socketserver.BaseServer,
|
||||||
*,
|
*,
|
||||||
directory: str | None = None,
|
directory: StrPath | None = None,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def do_GET(self) -> None: ...
|
def do_GET(self) -> None: ...
|
||||||
def do_HEAD(self) -> None: ...
|
def do_HEAD(self) -> None: ...
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import builtins
|
||||||
from _typeshed import MaybeNone, SupportsWrite
|
from _typeshed import MaybeNone, SupportsWrite
|
||||||
from abc import abstractmethod
|
from abc import abstractmethod
|
||||||
from collections.abc import Callable, Iterable, Mapping, Sequence
|
from collections.abc import Callable, Iterable, Mapping, Sequence
|
||||||
from typing import Any, ClassVar, Literal, NoReturn, overload
|
from typing import Any, ClassVar, Final, Literal, NoReturn, overload
|
||||||
from typing_extensions import Self
|
from typing_extensions import Self
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
|
|
@ -24,10 +24,10 @@ __all__ = [
|
||||||
"BadOptionError",
|
"BadOptionError",
|
||||||
"check_choice",
|
"check_choice",
|
||||||
]
|
]
|
||||||
|
# pytype is not happy with `NO_DEFAULT: Final = ("NO", "DEFAULT")`
|
||||||
NO_DEFAULT: tuple[str, ...]
|
NO_DEFAULT: Final[tuple[Literal["NO"], Literal["DEFAULT"]]]
|
||||||
SUPPRESS_HELP: str
|
SUPPRESS_HELP: Final = "SUPPRESSHELP"
|
||||||
SUPPRESS_USAGE: str
|
SUPPRESS_USAGE: Final = "SUPPRESSUSAGE"
|
||||||
|
|
||||||
# Can return complex, float, or int depending on the option's type
|
# Can return complex, float, or int depending on the option's type
|
||||||
def check_builtin(option: Option, opt: str, value: str) -> complex: ...
|
def check_builtin(option: Option, opt: str, value: str) -> complex: ...
|
||||||
|
|
|
||||||
|
|
@ -240,6 +240,7 @@ if sys.platform == "linux" and sys.version_info >= (3, 12):
|
||||||
"CLONE_VM",
|
"CLONE_VM",
|
||||||
"setns",
|
"setns",
|
||||||
"unshare",
|
"unshare",
|
||||||
|
"PIDFD_NONBLOCK",
|
||||||
]
|
]
|
||||||
if sys.platform == "linux" and sys.version_info >= (3, 10):
|
if sys.platform == "linux" and sys.version_info >= (3, 10):
|
||||||
__all__ += [
|
__all__ += [
|
||||||
|
|
@ -1603,6 +1604,9 @@ if sys.version_info >= (3, 9):
|
||||||
if sys.platform == "linux":
|
if sys.platform == "linux":
|
||||||
def pidfd_open(pid: int, flags: int = ...) -> int: ...
|
def pidfd_open(pid: int, flags: int = ...) -> int: ...
|
||||||
|
|
||||||
|
if sys.version_info >= (3, 12) and sys.platform == "linux":
|
||||||
|
PIDFD_NONBLOCK: Final = 2048
|
||||||
|
|
||||||
if sys.version_info >= (3, 12) and sys.platform == "win32":
|
if sys.version_info >= (3, 12) and sys.platform == "win32":
|
||||||
def listdrives() -> list[str]: ...
|
def listdrives() -> list[str]: ...
|
||||||
def listmounts(volume: str) -> list[str]: ...
|
def listmounts(volume: str) -> list[str]: ...
|
||||||
|
|
|
||||||
|
|
@ -379,6 +379,7 @@ if sys.platform != "win32":
|
||||||
CLONE_SYSVSEM as CLONE_SYSVSEM,
|
CLONE_SYSVSEM as CLONE_SYSVSEM,
|
||||||
CLONE_THREAD as CLONE_THREAD,
|
CLONE_THREAD as CLONE_THREAD,
|
||||||
CLONE_VM as CLONE_VM,
|
CLONE_VM as CLONE_VM,
|
||||||
|
PIDFD_NONBLOCK as PIDFD_NONBLOCK,
|
||||||
setns as setns,
|
setns as setns,
|
||||||
unshare as unshare,
|
unshare as unshare,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import sre_constants
|
||||||
import sys
|
import sys
|
||||||
from _typeshed import MaybeNone, ReadableBuffer
|
from _typeshed import MaybeNone, ReadableBuffer
|
||||||
from collections.abc import Callable, Iterator, Mapping
|
from collections.abc import Callable, Iterator, Mapping
|
||||||
from typing import Any, AnyStr, Generic, Literal, TypeVar, final, overload
|
from typing import Any, AnyStr, Final, Generic, Literal, TypeVar, final, overload
|
||||||
from typing_extensions import TypeAlias
|
from typing_extensions import TypeAlias
|
||||||
|
|
||||||
if sys.version_info >= (3, 9):
|
if sys.version_info >= (3, 9):
|
||||||
|
|
@ -224,25 +224,27 @@ class RegexFlag(enum.IntFlag):
|
||||||
if sys.version_info >= (3, 11):
|
if sys.version_info >= (3, 11):
|
||||||
NOFLAG = 0
|
NOFLAG = 0
|
||||||
|
|
||||||
A = RegexFlag.A
|
A: Final = RegexFlag.A
|
||||||
ASCII = RegexFlag.ASCII
|
ASCII: Final = RegexFlag.ASCII
|
||||||
DEBUG = RegexFlag.DEBUG
|
DEBUG: Final = RegexFlag.DEBUG
|
||||||
I = RegexFlag.I
|
I: Final = RegexFlag.I
|
||||||
IGNORECASE = RegexFlag.IGNORECASE
|
IGNORECASE: Final = RegexFlag.IGNORECASE
|
||||||
L = RegexFlag.L
|
L: Final = RegexFlag.L
|
||||||
LOCALE = RegexFlag.LOCALE
|
LOCALE: Final = RegexFlag.LOCALE
|
||||||
M = RegexFlag.M
|
M: Final = RegexFlag.M
|
||||||
MULTILINE = RegexFlag.MULTILINE
|
MULTILINE: Final = RegexFlag.MULTILINE
|
||||||
S = RegexFlag.S
|
S: Final = RegexFlag.S
|
||||||
DOTALL = RegexFlag.DOTALL
|
DOTALL: Final = RegexFlag.DOTALL
|
||||||
X = RegexFlag.X
|
X: Final = RegexFlag.X
|
||||||
VERBOSE = RegexFlag.VERBOSE
|
VERBOSE: Final = RegexFlag.VERBOSE
|
||||||
U = RegexFlag.U
|
U: Final = RegexFlag.U
|
||||||
UNICODE = RegexFlag.UNICODE
|
UNICODE: Final = RegexFlag.UNICODE
|
||||||
if sys.version_info < (3, 13):
|
if sys.version_info < (3, 13):
|
||||||
T = RegexFlag.T
|
T: Final = RegexFlag.T
|
||||||
TEMPLATE = RegexFlag.TEMPLATE
|
TEMPLATE: Final = RegexFlag.TEMPLATE
|
||||||
if sys.version_info >= (3, 11):
|
if sys.version_info >= (3, 11):
|
||||||
|
# pytype chokes on `NOFLAG: Final = RegexFlag.NOFLAG` with `LiteralValueError`
|
||||||
|
# mypy chokes on `NOFLAG: Final[Literal[RegexFlag.NOFLAG]]` with `Literal[...] is invalid`
|
||||||
NOFLAG = RegexFlag.NOFLAG
|
NOFLAG = RegexFlag.NOFLAG
|
||||||
_FlagsType: TypeAlias = int | RegexFlag
|
_FlagsType: TypeAlias = int | RegexFlag
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ class _RmtreeType(Protocol):
|
||||||
self,
|
self,
|
||||||
path: StrOrBytesPath,
|
path: StrOrBytesPath,
|
||||||
ignore_errors: bool,
|
ignore_errors: bool,
|
||||||
onerror: _OnErrorCallback,
|
onerror: _OnErrorCallback | None,
|
||||||
*,
|
*,
|
||||||
onexc: None = None,
|
onexc: None = None,
|
||||||
dir_fd: int | None = None,
|
dir_fd: int | None = None,
|
||||||
|
|
@ -95,7 +95,7 @@ class _RmtreeType(Protocol):
|
||||||
path: StrOrBytesPath,
|
path: StrOrBytesPath,
|
||||||
ignore_errors: bool = False,
|
ignore_errors: bool = False,
|
||||||
*,
|
*,
|
||||||
onerror: _OnErrorCallback,
|
onerror: _OnErrorCallback | None,
|
||||||
onexc: None = None,
|
onexc: None = None,
|
||||||
dir_fd: int | None = None,
|
dir_fd: int | None = None,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
|
|
||||||
|
|
@ -515,7 +515,7 @@ if sys.platform != "win32":
|
||||||
"IPV6_RTHDRDSTOPTS",
|
"IPV6_RTHDRDSTOPTS",
|
||||||
]
|
]
|
||||||
|
|
||||||
if sys.platform != "darwin" or sys.version_info >= (3, 13):
|
if sys.platform != "darwin":
|
||||||
from _socket import SO_BINDTODEVICE as SO_BINDTODEVICE
|
from _socket import SO_BINDTODEVICE as SO_BINDTODEVICE
|
||||||
|
|
||||||
__all__ += ["SO_BINDTODEVICE"]
|
__all__ += ["SO_BINDTODEVICE"]
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,17 @@
|
||||||
import sys
|
import sys
|
||||||
from re import error as error
|
from re import error as error
|
||||||
from typing import Any
|
from typing import Final
|
||||||
from typing_extensions import Self
|
from typing_extensions import Self
|
||||||
|
|
||||||
MAXGROUPS: int
|
MAXGROUPS: Final[int]
|
||||||
|
|
||||||
MAGIC: int
|
MAGIC: Final[int]
|
||||||
|
|
||||||
class _NamedIntConstant(int):
|
class _NamedIntConstant(int):
|
||||||
name: Any
|
name: str
|
||||||
def __new__(cls, value: int, name: str) -> Self: ...
|
def __new__(cls, value: int, name: str) -> Self: ...
|
||||||
|
|
||||||
MAXREPEAT: _NamedIntConstant
|
MAXREPEAT: Final[_NamedIntConstant]
|
||||||
OPCODES: list[_NamedIntConstant]
|
OPCODES: list[_NamedIntConstant]
|
||||||
ATCODES: list[_NamedIntConstant]
|
ATCODES: list[_NamedIntConstant]
|
||||||
CHCODES: list[_NamedIntConstant]
|
CHCODES: list[_NamedIntConstant]
|
||||||
|
|
@ -23,102 +23,104 @@ AT_LOCALE: dict[_NamedIntConstant, _NamedIntConstant]
|
||||||
AT_UNICODE: dict[_NamedIntConstant, _NamedIntConstant]
|
AT_UNICODE: dict[_NamedIntConstant, _NamedIntConstant]
|
||||||
CH_LOCALE: dict[_NamedIntConstant, _NamedIntConstant]
|
CH_LOCALE: dict[_NamedIntConstant, _NamedIntConstant]
|
||||||
CH_UNICODE: dict[_NamedIntConstant, _NamedIntConstant]
|
CH_UNICODE: dict[_NamedIntConstant, _NamedIntConstant]
|
||||||
|
# flags
|
||||||
if sys.version_info < (3, 13):
|
if sys.version_info < (3, 13):
|
||||||
SRE_FLAG_TEMPLATE: int
|
SRE_FLAG_TEMPLATE: Final = 1
|
||||||
SRE_FLAG_IGNORECASE: int
|
SRE_FLAG_IGNORECASE: Final = 2
|
||||||
SRE_FLAG_LOCALE: int
|
SRE_FLAG_LOCALE: Final = 4
|
||||||
SRE_FLAG_MULTILINE: int
|
SRE_FLAG_MULTILINE: Final = 8
|
||||||
SRE_FLAG_DOTALL: int
|
SRE_FLAG_DOTALL: Final = 16
|
||||||
SRE_FLAG_UNICODE: int
|
SRE_FLAG_UNICODE: Final = 32
|
||||||
SRE_FLAG_VERBOSE: int
|
SRE_FLAG_VERBOSE: Final = 64
|
||||||
SRE_FLAG_DEBUG: int
|
SRE_FLAG_DEBUG: Final = 128
|
||||||
SRE_FLAG_ASCII: int
|
SRE_FLAG_ASCII: Final = 256
|
||||||
SRE_INFO_PREFIX: int
|
# flags for INFO primitive
|
||||||
SRE_INFO_LITERAL: int
|
SRE_INFO_PREFIX: Final = 1
|
||||||
SRE_INFO_CHARSET: int
|
SRE_INFO_LITERAL: Final = 2
|
||||||
|
SRE_INFO_CHARSET: Final = 4
|
||||||
|
|
||||||
# Stubgen above; manually defined constants below (dynamic at runtime)
|
# Stubgen above; manually defined constants below (dynamic at runtime)
|
||||||
|
|
||||||
# from OPCODES
|
# from OPCODES
|
||||||
FAILURE: _NamedIntConstant
|
FAILURE: Final[_NamedIntConstant]
|
||||||
SUCCESS: _NamedIntConstant
|
SUCCESS: Final[_NamedIntConstant]
|
||||||
ANY: _NamedIntConstant
|
ANY: Final[_NamedIntConstant]
|
||||||
ANY_ALL: _NamedIntConstant
|
ANY_ALL: Final[_NamedIntConstant]
|
||||||
ASSERT: _NamedIntConstant
|
ASSERT: Final[_NamedIntConstant]
|
||||||
ASSERT_NOT: _NamedIntConstant
|
ASSERT_NOT: Final[_NamedIntConstant]
|
||||||
AT: _NamedIntConstant
|
AT: Final[_NamedIntConstant]
|
||||||
BRANCH: _NamedIntConstant
|
BRANCH: Final[_NamedIntConstant]
|
||||||
if sys.version_info < (3, 11):
|
if sys.version_info < (3, 11):
|
||||||
CALL: _NamedIntConstant
|
CALL: Final[_NamedIntConstant]
|
||||||
CATEGORY: _NamedIntConstant
|
CATEGORY: Final[_NamedIntConstant]
|
||||||
CHARSET: _NamedIntConstant
|
CHARSET: Final[_NamedIntConstant]
|
||||||
BIGCHARSET: _NamedIntConstant
|
BIGCHARSET: Final[_NamedIntConstant]
|
||||||
GROUPREF: _NamedIntConstant
|
GROUPREF: Final[_NamedIntConstant]
|
||||||
GROUPREF_EXISTS: _NamedIntConstant
|
GROUPREF_EXISTS: Final[_NamedIntConstant]
|
||||||
GROUPREF_IGNORE: _NamedIntConstant
|
GROUPREF_IGNORE: Final[_NamedIntConstant]
|
||||||
IN: _NamedIntConstant
|
IN: Final[_NamedIntConstant]
|
||||||
IN_IGNORE: _NamedIntConstant
|
IN_IGNORE: Final[_NamedIntConstant]
|
||||||
INFO: _NamedIntConstant
|
INFO: Final[_NamedIntConstant]
|
||||||
JUMP: _NamedIntConstant
|
JUMP: Final[_NamedIntConstant]
|
||||||
LITERAL: _NamedIntConstant
|
LITERAL: Final[_NamedIntConstant]
|
||||||
LITERAL_IGNORE: _NamedIntConstant
|
LITERAL_IGNORE: Final[_NamedIntConstant]
|
||||||
MARK: _NamedIntConstant
|
MARK: Final[_NamedIntConstant]
|
||||||
MAX_UNTIL: _NamedIntConstant
|
MAX_UNTIL: Final[_NamedIntConstant]
|
||||||
MIN_UNTIL: _NamedIntConstant
|
MIN_UNTIL: Final[_NamedIntConstant]
|
||||||
NOT_LITERAL: _NamedIntConstant
|
NOT_LITERAL: Final[_NamedIntConstant]
|
||||||
NOT_LITERAL_IGNORE: _NamedIntConstant
|
NOT_LITERAL_IGNORE: Final[_NamedIntConstant]
|
||||||
NEGATE: _NamedIntConstant
|
NEGATE: Final[_NamedIntConstant]
|
||||||
RANGE: _NamedIntConstant
|
RANGE: Final[_NamedIntConstant]
|
||||||
REPEAT: _NamedIntConstant
|
REPEAT: Final[_NamedIntConstant]
|
||||||
REPEAT_ONE: _NamedIntConstant
|
REPEAT_ONE: Final[_NamedIntConstant]
|
||||||
SUBPATTERN: _NamedIntConstant
|
SUBPATTERN: Final[_NamedIntConstant]
|
||||||
MIN_REPEAT_ONE: _NamedIntConstant
|
MIN_REPEAT_ONE: Final[_NamedIntConstant]
|
||||||
if sys.version_info >= (3, 11):
|
if sys.version_info >= (3, 11):
|
||||||
ATOMIC_GROUP: _NamedIntConstant
|
ATOMIC_GROUP: Final[_NamedIntConstant]
|
||||||
POSSESSIVE_REPEAT: _NamedIntConstant
|
POSSESSIVE_REPEAT: Final[_NamedIntConstant]
|
||||||
POSSESSIVE_REPEAT_ONE: _NamedIntConstant
|
POSSESSIVE_REPEAT_ONE: Final[_NamedIntConstant]
|
||||||
RANGE_UNI_IGNORE: _NamedIntConstant
|
RANGE_UNI_IGNORE: Final[_NamedIntConstant]
|
||||||
GROUPREF_LOC_IGNORE: _NamedIntConstant
|
GROUPREF_LOC_IGNORE: Final[_NamedIntConstant]
|
||||||
GROUPREF_UNI_IGNORE: _NamedIntConstant
|
GROUPREF_UNI_IGNORE: Final[_NamedIntConstant]
|
||||||
IN_LOC_IGNORE: _NamedIntConstant
|
IN_LOC_IGNORE: Final[_NamedIntConstant]
|
||||||
IN_UNI_IGNORE: _NamedIntConstant
|
IN_UNI_IGNORE: Final[_NamedIntConstant]
|
||||||
LITERAL_LOC_IGNORE: _NamedIntConstant
|
LITERAL_LOC_IGNORE: Final[_NamedIntConstant]
|
||||||
LITERAL_UNI_IGNORE: _NamedIntConstant
|
LITERAL_UNI_IGNORE: Final[_NamedIntConstant]
|
||||||
NOT_LITERAL_LOC_IGNORE: _NamedIntConstant
|
NOT_LITERAL_LOC_IGNORE: Final[_NamedIntConstant]
|
||||||
NOT_LITERAL_UNI_IGNORE: _NamedIntConstant
|
NOT_LITERAL_UNI_IGNORE: Final[_NamedIntConstant]
|
||||||
MIN_REPEAT: _NamedIntConstant
|
MIN_REPEAT: Final[_NamedIntConstant]
|
||||||
MAX_REPEAT: _NamedIntConstant
|
MAX_REPEAT: Final[_NamedIntConstant]
|
||||||
|
|
||||||
# from ATCODES
|
# from ATCODES
|
||||||
AT_BEGINNING: _NamedIntConstant
|
AT_BEGINNING: Final[_NamedIntConstant]
|
||||||
AT_BEGINNING_LINE: _NamedIntConstant
|
AT_BEGINNING_LINE: Final[_NamedIntConstant]
|
||||||
AT_BEGINNING_STRING: _NamedIntConstant
|
AT_BEGINNING_STRING: Final[_NamedIntConstant]
|
||||||
AT_BOUNDARY: _NamedIntConstant
|
AT_BOUNDARY: Final[_NamedIntConstant]
|
||||||
AT_NON_BOUNDARY: _NamedIntConstant
|
AT_NON_BOUNDARY: Final[_NamedIntConstant]
|
||||||
AT_END: _NamedIntConstant
|
AT_END: Final[_NamedIntConstant]
|
||||||
AT_END_LINE: _NamedIntConstant
|
AT_END_LINE: Final[_NamedIntConstant]
|
||||||
AT_END_STRING: _NamedIntConstant
|
AT_END_STRING: Final[_NamedIntConstant]
|
||||||
AT_LOC_BOUNDARY: _NamedIntConstant
|
AT_LOC_BOUNDARY: Final[_NamedIntConstant]
|
||||||
AT_LOC_NON_BOUNDARY: _NamedIntConstant
|
AT_LOC_NON_BOUNDARY: Final[_NamedIntConstant]
|
||||||
AT_UNI_BOUNDARY: _NamedIntConstant
|
AT_UNI_BOUNDARY: Final[_NamedIntConstant]
|
||||||
AT_UNI_NON_BOUNDARY: _NamedIntConstant
|
AT_UNI_NON_BOUNDARY: Final[_NamedIntConstant]
|
||||||
|
|
||||||
# from CHCODES
|
# from CHCODES
|
||||||
CATEGORY_DIGIT: _NamedIntConstant
|
CATEGORY_DIGIT: Final[_NamedIntConstant]
|
||||||
CATEGORY_NOT_DIGIT: _NamedIntConstant
|
CATEGORY_NOT_DIGIT: Final[_NamedIntConstant]
|
||||||
CATEGORY_SPACE: _NamedIntConstant
|
CATEGORY_SPACE: Final[_NamedIntConstant]
|
||||||
CATEGORY_NOT_SPACE: _NamedIntConstant
|
CATEGORY_NOT_SPACE: Final[_NamedIntConstant]
|
||||||
CATEGORY_WORD: _NamedIntConstant
|
CATEGORY_WORD: Final[_NamedIntConstant]
|
||||||
CATEGORY_NOT_WORD: _NamedIntConstant
|
CATEGORY_NOT_WORD: Final[_NamedIntConstant]
|
||||||
CATEGORY_LINEBREAK: _NamedIntConstant
|
CATEGORY_LINEBREAK: Final[_NamedIntConstant]
|
||||||
CATEGORY_NOT_LINEBREAK: _NamedIntConstant
|
CATEGORY_NOT_LINEBREAK: Final[_NamedIntConstant]
|
||||||
CATEGORY_LOC_WORD: _NamedIntConstant
|
CATEGORY_LOC_WORD: Final[_NamedIntConstant]
|
||||||
CATEGORY_LOC_NOT_WORD: _NamedIntConstant
|
CATEGORY_LOC_NOT_WORD: Final[_NamedIntConstant]
|
||||||
CATEGORY_UNI_DIGIT: _NamedIntConstant
|
CATEGORY_UNI_DIGIT: Final[_NamedIntConstant]
|
||||||
CATEGORY_UNI_NOT_DIGIT: _NamedIntConstant
|
CATEGORY_UNI_NOT_DIGIT: Final[_NamedIntConstant]
|
||||||
CATEGORY_UNI_SPACE: _NamedIntConstant
|
CATEGORY_UNI_SPACE: Final[_NamedIntConstant]
|
||||||
CATEGORY_UNI_NOT_SPACE: _NamedIntConstant
|
CATEGORY_UNI_NOT_SPACE: Final[_NamedIntConstant]
|
||||||
CATEGORY_UNI_WORD: _NamedIntConstant
|
CATEGORY_UNI_WORD: Final[_NamedIntConstant]
|
||||||
CATEGORY_UNI_NOT_WORD: _NamedIntConstant
|
CATEGORY_UNI_NOT_WORD: Final[_NamedIntConstant]
|
||||||
CATEGORY_UNI_LINEBREAK: _NamedIntConstant
|
CATEGORY_UNI_LINEBREAK: Final[_NamedIntConstant]
|
||||||
CATEGORY_UNI_NOT_LINEBREAK: _NamedIntConstant
|
CATEGORY_UNI_NOT_LINEBREAK: Final[_NamedIntConstant]
|
||||||
|
|
|
||||||
|
|
@ -1100,7 +1100,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||||
open: bool = ...,
|
open: bool = ...,
|
||||||
tags: str | list[str] | tuple[str, ...] = ...,
|
tags: str | list[str] | tuple[str, ...] = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def move(self, item: str | int, parent: str, index: int) -> None: ...
|
def move(self, item: str | int, parent: str, index: int | Literal["end"]) -> None: ...
|
||||||
reattach = move
|
reattach = move
|
||||||
def next(self, item: str | int) -> str: ... # returning empty string means last item
|
def next(self, item: str | int) -> str: ... # returning empty string means last item
|
||||||
def parent(self, item: str | int) -> str: ...
|
def parent(self, item: str | int) -> str: ...
|
||||||
|
|
|
||||||
|
|
@ -125,6 +125,9 @@ class Untokenizer:
|
||||||
prev_col: int
|
prev_col: int
|
||||||
encoding: str | None
|
encoding: str | None
|
||||||
def add_whitespace(self, start: _Position) -> None: ...
|
def add_whitespace(self, start: _Position) -> None: ...
|
||||||
|
if sys.version_info >= (3, 13):
|
||||||
|
def add_backslash_continuation(self, start: _Position) -> None: ...
|
||||||
|
|
||||||
def untokenize(self, iterable: Iterable[_Token]) -> str: ...
|
def untokenize(self, iterable: Iterable[_Token]) -> str: ...
|
||||||
def compat(self, token: Sequence[int | str], iterable: Iterable[_Token]) -> None: ...
|
def compat(self, token: Sequence[int | str], iterable: Iterable[_Token]) -> None: ...
|
||||||
if sys.version_info >= (3, 12):
|
if sys.version_info >= (3, 12):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue