Updated typeshed stubs to the latest version.

This commit is contained in:
Eric Traut 2022-01-29 00:33:42 -08:00
parent 2ea67f19e4
commit e6627f4fb3
64 changed files with 1010 additions and 835 deletions

View File

@ -1 +1 @@
64bb71d7c12881cf544b3ee22a76a6e5224bae2d
7e79706dddd16e2b6fe7a5cb1103a82bae097898

View File

@ -62,6 +62,7 @@ array: 2.7-
ast: 2.7-
asynchat: 2.7-
asyncio: 3.4-
asyncio.mixins: 3.10-
asyncio.compat: 3.4-3.6
asyncio.exceptions: 3.8-
asyncio.format_helpers: 3.7-

View File

@ -6,7 +6,7 @@ from asyncio.events import AbstractEventLoop, AbstractServer, Handle, TimerHandl
from asyncio.futures import Future
from asyncio.protocols import BaseProtocol
from asyncio.tasks import Task
from asyncio.transports import BaseTransport
from asyncio.transports import BaseTransport, ReadTransport, SubprocessTransport, WriteTransport
from collections.abc import Iterable
from socket import AddressFamily, SocketKind, _Address, _RetAddress, socket
from typing import IO, Any, Awaitable, Callable, Generator, Sequence, TypeVar, Union, overload
@ -317,10 +317,10 @@ class BaseEventLoop(AbstractEventLoop, metaclass=ABCMeta):
# Pipes and subprocesses.
async def connect_read_pipe(
self, protocol_factory: Callable[[], _ProtocolT], pipe: Any
) -> tuple[BaseTransport, _ProtocolT]: ...
) -> tuple[ReadTransport, _ProtocolT]: ...
async def connect_write_pipe(
self, protocol_factory: Callable[[], _ProtocolT], pipe: Any
) -> tuple[BaseTransport, _ProtocolT]: ...
) -> tuple[WriteTransport, _ProtocolT]: ...
async def subprocess_shell(
self,
protocol_factory: Callable[[], _ProtocolT],
@ -336,7 +336,7 @@ class BaseEventLoop(AbstractEventLoop, metaclass=ABCMeta):
errors: None = ...,
text: Literal[False, None] = ...,
**kwargs: Any,
) -> tuple[BaseTransport, _ProtocolT]: ...
) -> tuple[SubprocessTransport, _ProtocolT]: ...
async def subprocess_exec(
self,
protocol_factory: Callable[[], _ProtocolT],
@ -351,11 +351,11 @@ class BaseEventLoop(AbstractEventLoop, metaclass=ABCMeta):
encoding: None = ...,
errors: None = ...,
**kwargs: Any,
) -> tuple[BaseTransport, _ProtocolT]: ...
) -> tuple[SubprocessTransport, _ProtocolT]: ...
def add_reader(self, fd: FileDescriptorLike, callback: Callable[..., Any], *args: Any) -> None: ...
def remove_reader(self, fd: FileDescriptorLike) -> None: ...
def remove_reader(self, fd: FileDescriptorLike) -> bool: ...
def add_writer(self, fd: FileDescriptorLike, callback: Callable[..., Any], *args: Any) -> None: ...
def remove_writer(self, fd: FileDescriptorLike) -> None: ...
def remove_writer(self, fd: FileDescriptorLike) -> bool: ...
# Completion based I/O methods returning Futures prior to 3.7
if sys.version_info >= (3, 7):
async def sock_recv(self, sock: socket, nbytes: int) -> bytes: ...

View File

@ -1,6 +1,6 @@
import sys
from typing import Any, Callable, Sequence
from typing_extensions import Literal
from typing_extensions import Literal, TypeGuard
if sys.version_info >= (3, 7):
from contextvars import Context
@ -11,7 +11,7 @@ _PENDING: Literal["PENDING"] # undocumented
_CANCELLED: Literal["CANCELLED"] # undocumented
_FINISHED: Literal["FINISHED"] # undocumented
def isfuture(obj: object) -> bool: ...
def isfuture(obj: object) -> TypeGuard[futures.Future[Any]]: ...
if sys.version_info >= (3, 7):
def _format_callbacks(cb: Sequence[tuple[Callable[[futures.Future[Any]], None], Context]]) -> str: ... # undocumented

View File

@ -10,7 +10,7 @@ from .base_events import Server
from .futures import Future
from .protocols import BaseProtocol
from .tasks import Task
from .transports import BaseTransport
from .transports import BaseTransport, ReadTransport, SubprocessTransport, WriteTransport
from .unix_events import AbstractChildWatcher
if sys.version_info >= (3, 7):
@ -376,11 +376,11 @@ class AbstractEventLoop(metaclass=ABCMeta):
@abstractmethod
async def connect_read_pipe(
self, protocol_factory: Callable[[], _ProtocolT], pipe: Any
) -> tuple[BaseTransport, _ProtocolT]: ...
) -> tuple[ReadTransport, _ProtocolT]: ...
@abstractmethod
async def connect_write_pipe(
self, protocol_factory: Callable[[], _ProtocolT], pipe: Any
) -> tuple[BaseTransport, _ProtocolT]: ...
) -> tuple[WriteTransport, _ProtocolT]: ...
@abstractmethod
async def subprocess_shell(
self,
@ -397,7 +397,7 @@ class AbstractEventLoop(metaclass=ABCMeta):
errors: None = ...,
text: Literal[False, None] = ...,
**kwargs: Any,
) -> tuple[BaseTransport, _ProtocolT]: ...
) -> tuple[SubprocessTransport, _ProtocolT]: ...
@abstractmethod
async def subprocess_exec(
self,
@ -413,15 +413,15 @@ class AbstractEventLoop(metaclass=ABCMeta):
encoding: None = ...,
errors: None = ...,
**kwargs: Any,
) -> tuple[BaseTransport, _ProtocolT]: ...
) -> tuple[SubprocessTransport, _ProtocolT]: ...
@abstractmethod
def add_reader(self, fd: FileDescriptorLike, callback: Callable[..., Any], *args: Any) -> None: ...
@abstractmethod
def remove_reader(self, fd: FileDescriptorLike) -> None: ...
def remove_reader(self, fd: FileDescriptorLike) -> bool: ...
@abstractmethod
def add_writer(self, fd: FileDescriptorLike, callback: Callable[..., Any], *args: Any) -> None: ...
@abstractmethod
def remove_writer(self, fd: FileDescriptorLike) -> None: ...
def remove_writer(self, fd: FileDescriptorLike) -> bool: ...
# Completion based I/O methods returning Futures prior to 3.7
if sys.version_info >= (3, 7):
@abstractmethod

View File

@ -31,8 +31,9 @@ def isfuture(obj: object) -> bool: ...
class Future(Awaitable[_T], Iterable[_T]):
_state: str
_exception: BaseException
_blocking = False
_log_traceback = False
_blocking: bool
_log_traceback: bool
_asyncio_future_blocking: bool # is a part of duck-typing contract for `Future`
def __init__(self, *, loop: AbstractEventLoop | None = ...) -> None: ...
def __del__(self) -> None: ...
if sys.version_info >= (3, 7):

View File

@ -0,0 +1,7 @@
import threading
from typing import NoReturn
_global_lock: threading.Lock
class _LoopBoundMixin:
def __init__(self, *, loop: NoReturn = ...) -> None: ...

View File

@ -15,6 +15,7 @@ if sys.version_info >= (3, 7):
class BufferedProtocol(BaseProtocol):
def get_buffer(self, sizehint: int) -> bytearray: ...
def buffer_updated(self, nbytes: int) -> None: ...
def eof_received(self) -> bool | None: ...
class DatagramProtocol(BaseProtocol):
def connection_made(self, transport: transports.DatagramTransport) -> None: ... # type: ignore[override]

View File

@ -1,5 +1,5 @@
import sys
from _typeshed import StrPath
from _typeshed import Self, StrPath
from typing import Any, AsyncIterator, Awaitable, Callable, Iterable, Optional
from . import events, protocols, transports
@ -117,7 +117,7 @@ class StreamWriter:
def get_extra_info(self, name: str, default: Any = ...) -> Any: ...
async def drain(self) -> None: ...
class StreamReader:
class StreamReader(AsyncIterator[bytes]):
def __init__(self, limit: int = ..., loop: events.AbstractEventLoop | None = ...) -> None: ...
def exception(self) -> Exception: ...
def set_exception(self, exc: Exception) -> None: ...
@ -129,5 +129,5 @@ class StreamReader:
async def readuntil(self, separator: bytes = ...) -> bytes: ...
async def read(self, n: int = ...) -> bytes: ...
async def readexactly(self, n: int) -> bytes: ...
def __aiter__(self) -> AsyncIterator[bytes]: ...
def __aiter__(self: Self) -> Self: ...
async def __anext__(self) -> bytes: ...

View File

@ -1,10 +1,11 @@
from types import CodeType, FrameType, TracebackType
from typing import IO, Any, Callable, Iterable, Mapping, SupportsInt, TypeVar
from typing_extensions import Literal
from typing_extensions import Literal, ParamSpec
__all__ = ["BdbQuit", "Bdb", "Breakpoint"]
_T = TypeVar("_T")
_P = ParamSpec("_P")
_TraceDispatch = Callable[[FrameType, str, Any], Any] # TODO: Recursive type
_ExcInfo = tuple[type[BaseException], BaseException, FrameType]
@ -64,7 +65,7 @@ class Bdb:
def run(self, cmd: str | CodeType, globals: dict[str, Any] | None = ..., locals: Mapping[str, Any] | None = ...) -> None: ...
def runeval(self, expr: str, globals: dict[str, Any] | None = ..., locals: Mapping[str, Any] | None = ...) -> None: ...
def runctx(self, cmd: str | CodeType, globals: dict[str, Any] | None, locals: Mapping[str, Any] | None) -> None: ...
def runcall(self, __func: Callable[..., _T], *args: Any, **kwds: Any) -> _T | None: ...
def runcall(self, __func: Callable[_P, _T], *args: _P.args, **kwds: _P.kwargs) -> _T | None: ...
class Breakpoint:

View File

@ -296,7 +296,8 @@ class float:
def __rtruediv__(self, __x: float) -> float: ...
def __rmod__(self, __x: float) -> float: ...
def __rdivmod__(self, __x: float) -> tuple[float, float]: ...
def __rpow__(self, __x: float, __mod: None = ...) -> float: ...
# Returns complex if the argument is negative.
def __rpow__(self, __x: float, __mod: None = ...) -> Any: ...
def __getnewargs__(self) -> tuple[float]: ...
def __trunc__(self) -> int: ...
if sys.version_info >= (3, 9):

View File

@ -2,6 +2,7 @@ import sys
from _typeshed import Self, StrOrBytesPath
from types import CodeType
from typing import Any, Callable, TypeVar
from typing_extensions import ParamSpec
def run(statement: str, filename: str | None = ..., sort: str | int = ...) -> None: ...
def runctx(
@ -9,6 +10,7 @@ def runctx(
) -> None: ...
_T = TypeVar("_T")
_P = ParamSpec("_P")
_Label = tuple[str, int, str]
class Profile:
@ -24,7 +26,7 @@ class Profile:
def snapshot_stats(self) -> None: ...
def run(self: Self, cmd: str) -> Self: ...
def runctx(self: Self, cmd: str, globals: dict[str, Any], locals: dict[str, Any]) -> Self: ...
def runcall(self, __func: Callable[..., _T], *args: Any, **kw: Any) -> _T: ...
def runcall(self, __func: Callable[_P, _T], *args: _P.args, **kw: _P.kwargs) -> _T: ...
if sys.version_info >= (3, 8):
def __enter__(self: Self) -> Self: ...
def __exit__(self, *exc_info: Any) -> None: ...

View File

@ -86,7 +86,7 @@ class CodecInfo(tuple[_Encoder, _Decoder, _StreamReader, _StreamWriter]):
def incrementaldecoder(self) -> _IncrementalDecoder: ...
name: str
def __new__(
cls,
cls: type[Self],
encode: _Encoder,
decode: _Decoder,
streamreader: _StreamReader | None = ...,
@ -96,7 +96,7 @@ class CodecInfo(tuple[_Encoder, _Decoder, _StreamReader, _StreamWriter]):
name: str | None = ...,
*,
_is_text_encoding: bool | None = ...,
) -> CodecInfo: ...
) -> Self: ...
def getencoder(encoding: str) -> _Encoder: ...
def getdecoder(encoding: str) -> _Decoder: ...
@ -189,7 +189,7 @@ class StreamWriter(Codec):
def __exit__(self, typ: type[BaseException] | None, exc: BaseException | None, tb: types.TracebackType | None) -> None: ...
def __getattr__(self, name: str, getattr: Callable[[str], Any] = ...) -> Any: ...
class StreamReader(Codec):
class StreamReader(Codec, Iterator[str]):
errors: str
def __init__(self, stream: IO[bytes], errors: str = ...) -> None: ...
def read(self, size: int = ..., chars: int = ..., firstline: bool = ...) -> str: ...
@ -198,7 +198,8 @@ class StreamReader(Codec):
def reset(self) -> None: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, typ: type[BaseException] | None, exc: BaseException | None, tb: types.TracebackType | None) -> None: ...
def __iter__(self) -> Iterator[str]: ...
def __iter__(self: Self) -> Self: ...
def __next__(self) -> str: ...
def __getattr__(self, name: str, getattr: Callable[[str], Any] = ...) -> Any: ...
# Doesn't actually inherit from TextIO, but wraps a BinaryIO to provide text reading and writing

View File

@ -225,7 +225,9 @@ class deque(MutableSequence[_T], Generic[_T]):
class Counter(dict[_T, int], Generic[_T]):
@overload
def __init__(self, __iterable: None = ..., **kwargs: int) -> None: ...
def __init__(self: Counter[_T], __iterable: None = ...) -> None: ...
@overload
def __init__(self: Counter[str], __iterable: None = ..., **kwargs: int) -> None: ...
@overload
def __init__(self, __mapping: SupportsKeysAndGetItem[_T, int]) -> None: ...
@overload
@ -298,22 +300,30 @@ class OrderedDict(dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]):
class defaultdict(dict[_KT, _VT], Generic[_KT, _VT]):
default_factory: Callable[[], _VT] | None
@overload
def __init__(self, **kwargs: _VT) -> None: ...
def __init__(self: defaultdict[_KT, _VT]) -> None: ...
@overload
def __init__(self: defaultdict[str, _VT], **kwargs: _VT) -> None: ...
@overload
def __init__(self, __default_factory: Callable[[], _VT] | None) -> None: ...
@overload
def __init__(self, __default_factory: Callable[[], _VT] | None, **kwargs: _VT) -> None: ...
def __init__(self: defaultdict[str, _VT], __default_factory: Callable[[], _VT] | None, **kwargs: _VT) -> None: ...
@overload
def __init__(self, __default_factory: Callable[[], _VT] | None, __map: SupportsKeysAndGetItem[_KT, _VT]) -> None: ...
@overload
def __init__(
self, __default_factory: Callable[[], _VT] | None, __map: SupportsKeysAndGetItem[_KT, _VT], **kwargs: _VT
self: defaultdict[str, _VT],
__default_factory: Callable[[], _VT] | None,
__map: SupportsKeysAndGetItem[str, _VT],
**kwargs: _VT,
) -> None: ...
@overload
def __init__(self, __default_factory: Callable[[], _VT] | None, __iterable: Iterable[tuple[_KT, _VT]]) -> None: ...
@overload
def __init__(
self, __default_factory: Callable[[], _VT] | None, __iterable: Iterable[tuple[_KT, _VT]], **kwargs: _VT
self: defaultdict[str, _VT],
__default_factory: Callable[[], _VT] | None,
__iterable: Iterable[tuple[str, _VT]],
**kwargs: _VT,
) -> None: ...
def __missing__(self, __key: _KT) -> _VT: ...
def __copy__(self: Self) -> Self: ...

View File

@ -104,7 +104,7 @@ class ExitStack(AbstractContextManager[ExitStack]):
def __init__(self) -> None: ...
def enter_context(self, cm: AbstractContextManager[_T]) -> _T: ...
def push(self, exit: _CM_EF) -> _CM_EF: ...
def callback(self, __callback: Callable[..., Any], *args: Any, **kwds: Any) -> Callable[..., Any]: ...
def callback(self, __callback: Callable[_P, _T], *args: _P.args, **kwds: _P.kwargs) -> Callable[_P, _T]: ...
def pop_all(self: Self) -> Self: ...
def close(self) -> None: ...
def __enter__(self: Self) -> Self: ...
@ -114,7 +114,6 @@ class ExitStack(AbstractContextManager[ExitStack]):
if sys.version_info >= (3, 7):
_ExitCoroFunc = Callable[[Optional[type[BaseException]], Optional[BaseException], Optional[TracebackType]], Awaitable[bool]]
_CallbackCoroFunc = Callable[..., Awaitable[Any]]
_ACM_EF = TypeVar("_ACM_EF", AbstractAsyncContextManager[Any], _ExitCoroFunc)
class AsyncExitStack(AbstractAsyncContextManager[AsyncExitStack]):
def __init__(self) -> None: ...
@ -122,8 +121,10 @@ if sys.version_info >= (3, 7):
def enter_async_context(self, cm: AbstractAsyncContextManager[_T]) -> Awaitable[_T]: ...
def push(self, exit: _CM_EF) -> _CM_EF: ...
def push_async_exit(self, exit: _ACM_EF) -> _ACM_EF: ...
def callback(self, __callback: Callable[..., Any], *args: Any, **kwds: Any) -> Callable[..., Any]: ...
def push_async_callback(self, __callback: _CallbackCoroFunc, *args: Any, **kwds: Any) -> _CallbackCoroFunc: ...
def callback(self, __callback: Callable[_P, _T], *args: _P.args, **kwds: _P.kwargs) -> Callable[_P, _T]: ...
def push_async_callback(
self, __callback: Callable[_P, Awaitable[_T]], *args: _P.args, **kwds: _P.kwargs
) -> Callable[_P, Awaitable[_T]]: ...
def pop_all(self: Self) -> Self: ...
def aclose(self) -> Awaitable[None]: ...
def __aenter__(self: Self) -> Awaitable[Self]: ...

View File

@ -17,6 +17,7 @@ from _csv import (
unregister_dialect as unregister_dialect,
writer as writer,
)
from _typeshed import Self
from collections.abc import Collection, Iterable, Iterator, Mapping, Sequence
from typing import Any, Generic, TypeVar, overload
@ -75,7 +76,7 @@ class DictReader(Generic[_T], Iterator[_DictReadMapping[_T, str]]):
*args: Any,
**kwds: Any,
) -> None: ...
def __iter__(self) -> DictReader[_T]: ...
def __iter__(self: Self) -> Self: ...
def __next__(self) -> _DictReadMapping[_T, str]: ...
class DictWriter(Generic[_T]):

View File

@ -2,7 +2,7 @@ import sys
from typing import Any, Callable, TypeVar
if sys.platform != "win32":
from _curses import * # noqa: F403
from _curses import *
from _curses import _CursesWindow as _CursesWindow
_T = TypeVar("_T")
@ -14,4 +14,6 @@ if sys.platform != "win32":
# available after calling `curses.start_color()`
COLORS: int
COLOR_PAIRS: int
# TODO: wait for `Concatenate` support
# def wrapper(__func: Callable[Concatenate[_CursesWindow, _P], _T], *arg: _P.args, **kwds: _P.kwargs) -> _T: ...
def wrapper(__func: Callable[..., _T], *arg: Any, **kwds: Any) -> _T: ...

View File

@ -2,7 +2,9 @@ from email.charset import Charset
from email.contentmanager import ContentManager
from email.errors import MessageDefect
from email.policy import Policy
from typing import Any, Generator, Iterator, Optional, Sequence, TypeVar, Union
# using a type alias ("_HeaderType = Any") breaks mypy, who knows why
from typing import Any, Any as _HeaderType, Generator, Iterator, Optional, Sequence, TypeVar, Union
_T = TypeVar("_T")
@ -10,7 +12,6 @@ _PayloadType = Union[list[Message], str, bytes]
_CharsetType = Union[Charset, str, None]
_ParamsType = Union[str, None, tuple[str, Optional[str], str]]
_ParamType = Union[str, tuple[Optional[str], Optional[str], str]]
_HeaderType = Any
class Message:
policy: Policy # undocumented

View File

@ -46,7 +46,7 @@ def fileno() -> int: ...
def isfirstline() -> bool: ...
def isstdin() -> bool: ...
class FileInput(Iterable[AnyStr], Generic[AnyStr]):
class FileInput(Iterator[AnyStr], Generic[AnyStr]):
if sys.version_info >= (3, 10):
def __init__(
self,
@ -83,7 +83,7 @@ class FileInput(Iterable[AnyStr], Generic[AnyStr]):
def close(self) -> None: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, type: Any, value: Any, traceback: Any) -> None: ...
def __iter__(self) -> Iterator[AnyStr]: ...
def __iter__(self: Self) -> Self: ...
def __next__(self) -> AnyStr: ...
if sys.version_info < (3, 11):
def __getitem__(self, i: int) -> AnyStr: ...

View File

@ -24,7 +24,11 @@ if sys.version_info >= (3, 7):
from types import ClassMethodDescriptorType, WrapperDescriptorType, MemberDescriptorType, MethodDescriptorType
from typing import Any, ClassVar, Coroutine, NamedTuple, Protocol, TypeVar, Union
from typing_extensions import Literal, TypeGuard
from typing_extensions import Literal, ParamSpec, TypeGuard
_P = ParamSpec("_P")
_T_cont = TypeVar("_T_cont", contravariant=True)
_V_cont = TypeVar("_V_cont", contravariant=True)
#
# Types and members
@ -80,9 +84,6 @@ if sys.version_info >= (3, 8):
else:
def isasyncgenfunction(object: object) -> bool: ...
_T_cont = TypeVar("_T_cont", contravariant=True)
_V_cont = TypeVar("_V_cont", contravariant=True)
class _SupportsSet(Protocol[_T_cont, _V_cont]):
def __set__(self, __instance: _T_cont, __value: _V_cont) -> None: ...
@ -166,7 +167,6 @@ class Signature:
empty = _empty
@property
def parameters(self) -> types.MappingProxyType[str, Parameter]: ...
# TODO: can we be more specific here?
@property
def return_annotation(self) -> Any: ...
def bind(self, *args: Any, **kwargs: Any) -> BoundArguments: ...
@ -177,17 +177,17 @@ class Signature:
if sys.version_info >= (3, 10):
@classmethod
def from_callable(
cls,
cls: type[Self],
obj: Callable[..., Any],
*,
follow_wrapped: bool = ...,
globals: Mapping[str, Any] | None = ...,
locals: Mapping[str, Any] | None = ...,
eval_str: bool = ...,
) -> Signature: ...
) -> Self: ...
else:
@classmethod
def from_callable(cls, obj: Callable[..., Any], *, follow_wrapped: bool = ...) -> Signature: ...
def from_callable(cls: type[Self], obj: Callable[..., Any], *, follow_wrapped: bool = ...) -> Self: ...
if sys.version_info >= (3, 10):
def get_annotations(
@ -318,7 +318,7 @@ def formatargvalues(
formatvalue: Callable[[Any], str] | None = ...,
) -> str: ...
def getmro(cls: type) -> tuple[type, ...]: ...
def getcallargs(__func: Callable[..., Any], *args: Any, **kwds: Any) -> dict[str, Any]: ...
def getcallargs(__func: Callable[_P, Any], *args: _P.args, **kwds: _P.kwargs) -> dict[str, Any]: ...
class ClosureVars(NamedTuple):
nonlocals: Mapping[str, Any]

View File

@ -1,12 +1,15 @@
import signal
import sys
from _typeshed import Self
from bdb import Bdb
from cmd import Cmd
from inspect import _SourceObjectType
from types import CodeType, FrameType, TracebackType
from typing import IO, Any, Callable, ClassVar, Iterable, Mapping, Sequence, TypeVar
from typing_extensions import ParamSpec
_T = TypeVar("_T")
_P = ParamSpec("_P")
line_prefix: str # undocumented
@ -15,7 +18,7 @@ class Restart(Exception): ...
def run(statement: str, globals: dict[str, Any] | None = ..., locals: Mapping[str, Any] | None = ...) -> None: ...
def runeval(expression: str, globals: dict[str, Any] | None = ..., locals: Mapping[str, Any] | None = ...) -> Any: ...
def runctx(statement: str, globals: dict[str, Any], locals: Mapping[str, Any]) -> None: ...
def runcall(func: Callable[..., _T], *args: Any, **kwds: Any) -> _T | None: ...
def runcall(func: Callable[_P, _T], *args: _P.args, **kwds: _P.kwargs) -> _T | None: ...
if sys.version_info >= (3, 7):
def set_trace(*, header: str | None = ...) -> None: ...
@ -171,4 +174,4 @@ def getsourcelines(obj: _SourceObjectType) -> tuple[list[str], int]: ...
def lasti2lineno(code: CodeType, lasti: int) -> int: ...
class _rstr(str):
def __repr__(self) -> _rstr: ...
def __repr__(self: Self) -> Self: ...

View File

@ -1,5 +1,6 @@
from _typeshed import Self, StrOrBytesPath
from typing import Any, Callable, TypeVar
from typing_extensions import ParamSpec
def run(statement: str, filename: str | None = ..., sort: str | int = ...) -> None: ...
def runctx(
@ -7,6 +8,7 @@ def runctx(
) -> None: ...
_T = TypeVar("_T")
_P = ParamSpec("_P")
_Label = tuple[str, int, str]
class Profile:
@ -22,5 +24,5 @@ class Profile:
def snapshot_stats(self) -> None: ...
def run(self: Self, cmd: str) -> Self: ...
def runctx(self: Self, cmd: str, globals: dict[str, Any], locals: dict[str, Any]) -> Self: ...
def runcall(self, __func: Callable[..., _T], *args: Any, **kw: Any) -> _T: ...
def runcall(self, __func: Callable[_P, _T], *args: _P.args, **kw: _P.kwargs) -> _T: ...
def calibrate(self, m: int, verbose: int = ...) -> float: ...

View File

@ -1 +1 @@
from sqlite3.dbapi2 import * # noqa: F403
from sqlite3.dbapi2 import *

View File

@ -1,4 +1,5 @@
import sys
from _typeshed import Self
from typing import Any
MAXGROUPS: int
@ -15,7 +16,7 @@ class error(Exception):
class _NamedIntConstant(int):
name: Any
def __new__(cls, value: int, name: str) -> _NamedIntConstant: ...
def __new__(cls: type[Self], value: int, name: str) -> Self: ...
MAXREPEAT: _NamedIntConstant
OPCODES: list[_NamedIntConstant]

View File

@ -396,7 +396,7 @@ class SSLContext:
if sys.version_info >= (3, 8):
keylog_filename: str
post_handshake_auth: bool
def __new__(cls, protocol: int = ..., *args: Any, **kwargs: Any) -> SSLContext: ...
def __new__(cls: type[Self], protocol: int = ..., *args: Any, **kwargs: Any) -> Self: ...
def __init__(self, protocol: int = ...) -> None: ...
def cert_store_stats(self) -> dict[str, int]: ...
def load_cert_chain(

View File

@ -1043,22 +1043,27 @@ if sys.platform == "win32":
wShowWindow: int
if sys.version_info >= (3, 7):
lpAttributeList: Mapping[str, Any]
STD_INPUT_HANDLE: Any
STD_OUTPUT_HANDLE: Any
STD_ERROR_HANDLE: Any
SW_HIDE: int
STARTF_USESTDHANDLES: int
STARTF_USESHOWWINDOW: int
CREATE_NEW_CONSOLE: int
CREATE_NEW_PROCESS_GROUP: int
from _winapi import (
CREATE_NEW_CONSOLE as CREATE_NEW_CONSOLE,
CREATE_NEW_PROCESS_GROUP as CREATE_NEW_PROCESS_GROUP,
STARTF_USESHOWWINDOW as STARTF_USESHOWWINDOW,
STARTF_USESTDHANDLES as STARTF_USESTDHANDLES,
STD_ERROR_HANDLE as STD_ERROR_HANDLE,
STD_INPUT_HANDLE as STD_INPUT_HANDLE,
STD_OUTPUT_HANDLE as STD_OUTPUT_HANDLE,
SW_HIDE as SW_HIDE,
)
if sys.version_info >= (3, 7):
ABOVE_NORMAL_PRIORITY_CLASS: int
BELOW_NORMAL_PRIORITY_CLASS: int
HIGH_PRIORITY_CLASS: int
IDLE_PRIORITY_CLASS: int
NORMAL_PRIORITY_CLASS: int
REALTIME_PRIORITY_CLASS: int
CREATE_NO_WINDOW: int
DETACHED_PROCESS: int
CREATE_DEFAULT_ERROR_MODE: int
CREATE_BREAKAWAY_FROM_JOB: int
from _winapi import (
ABOVE_NORMAL_PRIORITY_CLASS as ABOVE_NORMAL_PRIORITY_CLASS,
BELOW_NORMAL_PRIORITY_CLASS as BELOW_NORMAL_PRIORITY_CLASS,
CREATE_BREAKAWAY_FROM_JOB as CREATE_BREAKAWAY_FROM_JOB,
CREATE_DEFAULT_ERROR_MODE as CREATE_DEFAULT_ERROR_MODE,
CREATE_NO_WINDOW as CREATE_NO_WINDOW,
DETACHED_PROCESS as DETACHED_PROCESS,
HIGH_PRIORITY_CLASS as HIGH_PRIORITY_CLASS,
IDLE_PRIORITY_CLASS as IDLE_PRIORITY_CLASS,
NORMAL_PRIORITY_CLASS as NORMAL_PRIORITY_CLASS,
REALTIME_PRIORITY_CLASS as REALTIME_PRIORITY_CLASS,
)

View File

@ -1,6 +1,7 @@
import sys
from _typeshed import Self
from typing import IO, Any, NamedTuple, NoReturn, Union
from typing import IO, Any, NamedTuple, NoReturn, Union, overload
from typing_extensions import Literal
_File = Union[str, IO[bytes]]
@ -72,7 +73,11 @@ class Au_write:
def writeframes(self, data: bytes) -> None: ...
def close(self) -> None: ...
# Returns a Au_read if mode is rb and Au_write if mode is wb
@overload
def open(f: _File, mode: Literal["r", "rb"]) -> Au_read: ...
@overload
def open(f: _File, mode: Literal["w", "wb"]) -> Au_write: ...
@overload
def open(f: _File, mode: str | None = ...) -> Any: ...
if sys.version_info < (3, 9):

View File

@ -46,7 +46,7 @@ modules: dict[str, ModuleType]
if sys.version_info >= (3, 10):
orig_argv: list[str]
path: list[str]
path_hooks: list[Any] # TODO precise type; function, path to finder
path_hooks: list[Callable[[str], PathEntryFinder]]
path_importer_cache: dict[str, PathEntryFinder | None]
platform: str
if sys.version_info >= (3, 9):

View File

@ -1,8 +1,7 @@
import sys
from _typeshed import structseq
from types import SimpleNamespace
from typing import Any, Union
from typing_extensions import final
from typing import Any, Protocol, Union
from typing_extensions import Literal, final
_TimeTuple = tuple[int, int, int, int, int, int, int, int, int]
@ -80,7 +79,13 @@ def time() -> float: ...
if sys.platform != "win32":
def tzset() -> None: ... # Unix only
def get_clock_info(name: str) -> SimpleNamespace: ...
class _ClockInfo(Protocol):
adjustable: bool
implementation: str
monotonic: bool
resolution: float
def get_clock_info(name: Literal["monotonic", "perf_counter", "process_time", "time", "thread_time"]) -> _ClockInfo: ...
def monotonic() -> float: ...
def perf_counter() -> float: ...
def process_time() -> float: ...

View File

@ -25,7 +25,4 @@ def repeat(
number: int = ...,
globals: dict[str, Any] | None = ...,
) -> list[float]: ...
_timerFunc = Callable[[], float]
def main(args: Sequence[str] | None = ..., *, _wrap_timer: Callable[[_timerFunc], _timerFunc] | None = ...) -> None: ...
def main(args: Sequence[str] | None = ..., *, _wrap_timer: Callable[[_Timer], _Timer] | None = ...) -> None: ...

View File

@ -1,7 +1,7 @@
import sys
from _typeshed import StrOrBytesPath
from builtins import open as _builtin_open
from token import * # noqa: F403
from token import *
from typing import Any, Callable, Generator, Iterable, NamedTuple, Pattern, Sequence, TextIO, Union
if sys.version_info < (3, 7):

View File

@ -58,7 +58,10 @@ class FunctionType:
closure: tuple[_Cell, ...] | None = ...,
) -> None: ...
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
def __get__(self, obj: object | None, type: type | None = ...) -> MethodType: ...
@overload
def __get__(self, obj: None, type: type) -> FunctionType: ...
@overload
def __get__(self, obj: object, type: type | None = ...) -> MethodType: ...
LambdaType = FunctionType

View File

@ -16,7 +16,7 @@ Any = object()
class TypeVar:
__name__: str
__bound__: Any | None
__constraints__: Tuple[Any, ...]
__constraints__: tuple[Any, ...]
__covariant__: bool
__contravariant__: bool
def __init__(
@ -41,20 +41,27 @@ _T = TypeVar("_T")
def overload(func: _F) -> _F: ...
# Unlike the vast majority module-level objects in stub files,
# these `_SpecialForm` objects in typing need the default value `= ...`,
# due to the fact that they are used elswhere in the same file.
# Otherwise, flake8 erroneously flags them as undefined.
# `_SpecialForm` objects in typing.py that are not used elswhere in the same file
# do not need the default value assignment.
Union: _SpecialForm = ...
Optional: _SpecialForm = ...
Tuple: _SpecialForm = ...
Generic: _SpecialForm = ...
# Protocol is only present in 3.8 and later, but mypy needs it unconditionally
Protocol: _SpecialForm = ...
Callable: _SpecialForm = ...
Type: _SpecialForm = ...
ClassVar: _SpecialForm = ...
NoReturn: _SpecialForm = ...
Optional: _SpecialForm
Tuple: _SpecialForm
ClassVar: _SpecialForm
if sys.version_info >= (3, 8):
Final: _SpecialForm = ...
Final: _SpecialForm
def final(f: _T) -> _T: ...
Literal: _SpecialForm = ...
Literal: _SpecialForm
# TypedDict is a (non-subscriptable) special form.
TypedDict: object
@ -80,9 +87,9 @@ if sys.version_info >= (3, 10):
def kwargs(self) -> ParamSpecKwargs: ...
def __or__(self, other: Any) -> _SpecialForm: ...
def __ror__(self, other: Any) -> _SpecialForm: ...
Concatenate: _SpecialForm = ...
TypeAlias: _SpecialForm = ...
TypeGuard: _SpecialForm = ...
Concatenate: _SpecialForm
TypeAlias: _SpecialForm
TypeGuard: _SpecialForm
class NewType:
def __init__(self, name: str, tp: type) -> None: ...
def __call__(self, x: _T) -> _T: ...
@ -126,7 +133,7 @@ if sys.version_info >= (3, 7):
OrderedDict = _Alias()
if sys.version_info >= (3, 9):
Annotated: _SpecialForm = ...
Annotated: _SpecialForm
# Predefined type variables.
AnyStr = TypeVar("AnyStr", str, bytes) # noqa: Y001
@ -393,7 +400,7 @@ class MappingView(Sized):
def __init__(self, mapping: Mapping[Any, Any]) -> None: ... # undocumented
def __len__(self) -> int: ...
class ItemsView(MappingView, AbstractSet[Tuple[_KT_co, _VT_co]], Generic[_KT_co, _VT_co]):
class ItemsView(MappingView, AbstractSet[tuple[_KT_co, _VT_co]], Generic[_KT_co, _VT_co]):
def __init__(self, mapping: Mapping[_KT_co, _VT_co]) -> None: ... # undocumented
def __and__(self, o: Iterable[Any]) -> set[tuple[_KT_co, _VT_co]]: ...
def __rand__(self, o: Iterable[_T]) -> set[_T]: ...
@ -477,9 +484,9 @@ class MutableMapping(Mapping[_KT, _VT], Generic[_KT, _VT]):
def setdefault(self, __key: _KT, __default: _VT) -> _VT: ...
# 'update' used to take a Union, but using overloading is better.
# The second overloaded type here is a bit too general, because
# Mapping[Tuple[_KT, _VT], W] is a subclass of Iterable[Tuple[_KT, _VT]],
# Mapping[tuple[_KT, _VT], W] is a subclass of Iterable[tuple[_KT, _VT]],
# but will always have the behavior of the first overloaded type
# at runtime, leading to keys of a mix of types _KT and Tuple[_KT, _VT].
# at runtime, leading to keys of a mix of types _KT and tuple[_KT, _VT].
# We don't currently have any way of forcing all Mappings to use
# the first overload, but by using overloading rather than a Union,
# mypy will commit to using the first overload when the argument is
@ -502,7 +509,7 @@ class MutableMapping(Mapping[_KT, _VT], Generic[_KT, _VT]):
Text = str
TYPE_CHECKING = True
TYPE_CHECKING: bool
# In stubs, the arguments of the IO class are marked as positional-only.
# This differs from runtime, but better reflects the fact that in reality
@ -595,13 +602,13 @@ class Match(Generic[AnyStr]):
@overload
def group(self, __group: str | int) -> AnyStr | Any: ...
@overload
def group(self, __group1: str | int, __group2: str | int, *groups: str | int) -> Tuple[AnyStr | Any, ...]: ...
def group(self, __group1: str | int, __group2: str | int, *groups: str | int) -> tuple[AnyStr | Any, ...]: ...
# Each item of groups()'s return tuple is either "AnyStr" or
# "AnyStr | None", depending on the pattern.
@overload
def groups(self) -> Tuple[AnyStr | Any, ...]: ...
def groups(self) -> tuple[AnyStr | Any, ...]: ...
@overload
def groups(self, default: _T) -> Tuple[AnyStr | _T, ...]: ...
def groups(self, default: _T) -> tuple[AnyStr | _T, ...]: ...
# Each value in groupdict()'s return dict is either "AnyStr" or
# "AnyStr | None", depending on the pattern.
@overload
@ -612,7 +619,7 @@ class Match(Generic[AnyStr]):
def end(self, __group: int | str = ...) -> int: ...
def span(self, __group: int | str = ...) -> tuple[int, int]: ...
@property
def regs(self) -> Tuple[tuple[int, int], ...]: ... # undocumented
def regs(self) -> tuple[tuple[int, int], ...]: ... # undocumented
# __getitem__() returns "AnyStr" or "AnyStr | None", depending on the pattern.
@overload
def __getitem__(self, __key: _Literal[0]) -> AnyStr: ...
@ -678,7 +685,7 @@ else:
if sys.version_info >= (3, 8):
def get_origin(tp: Any) -> Any | None: ...
def get_args(tp: Any) -> Tuple[Any, ...]: ...
def get_args(tp: Any) -> tuple[Any, ...]: ...
@overload
def cast(typ: Type[_T], val: Any) -> _T: ...
@ -689,13 +696,13 @@ def cast(typ: object, val: Any) -> Any: ...
# Type constructors
class NamedTuple(Tuple[Any, ...]):
class NamedTuple(tuple[Any, ...]):
if sys.version_info < (3, 8):
_field_types: collections.OrderedDict[str, type]
elif sys.version_info < (3, 9):
_field_types: dict[str, type]
_field_defaults: dict[str, Any]
_fields: Tuple[str, ...]
_fields: tuple[str, ...]
_source: str
@overload
def __init__(self, typename: str, fields: Iterable[tuple[str, Any]] = ...) -> None: ...

View File

@ -22,34 +22,32 @@ from typing import ( # noqa Y022
Mapping,
NewType as NewType,
NoReturn as NoReturn,
Protocol as Protocol,
Text as Text,
Type as Type,
TypeVar,
ValuesView,
_Alias,
overload as overload,
runtime_checkable as runtime_checkable,
)
_T = TypeVar("_T")
_F = TypeVar("_F", bound=Callable[..., Any])
_TC = TypeVar("_TC", bound=type[object])
class _SpecialForm:
def __getitem__(self, typeargs: Any) -> Any: ...
def runtime_checkable(cls: _TC) -> _TC: ...
# This alias for above is kept here for backwards compatibility.
runtime = runtime_checkable
Protocol: _SpecialForm = ...
Final: _SpecialForm = ...
Self: _SpecialForm = ...
Required: _SpecialForm = ...
NotRequired: _SpecialForm = ...
Final: _SpecialForm
Self: _SpecialForm
Required: _SpecialForm
NotRequired: _SpecialForm
def final(f: _F) -> _F: ...
Literal: _SpecialForm = ...
Literal: _SpecialForm
def IntVar(name: str) -> Any: ... # returns a new TypeVar
@ -76,7 +74,7 @@ class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta):
def __delitem__(self, k: NoReturn) -> None: ...
# TypedDict is a (non-subscriptable) special form.
TypedDict: object = ...
TypedDict: object
OrderedDict = _Alias()
@ -90,8 +88,8 @@ if sys.version_info >= (3, 7):
def get_args(tp: Any) -> tuple[Any, ...]: ...
def get_origin(tp: Any) -> Any | None: ...
Annotated: _SpecialForm = ...
_AnnotatedAlias: Any = ... # undocumented
Annotated: _SpecialForm
_AnnotatedAlias: Any # undocumented
@runtime_checkable
class SupportsIndex(Protocol, metaclass=abc.ABCMeta):
@ -126,9 +124,9 @@ else:
def args(self) -> ParamSpecArgs: ...
@property
def kwargs(self) -> ParamSpecKwargs: ...
Concatenate: _SpecialForm = ...
TypeAlias: _SpecialForm = ...
TypeGuard: _SpecialForm = ...
Concatenate: _SpecialForm
TypeAlias: _SpecialForm
TypeGuard: _SpecialForm
def is_typeddict(tp: object) -> bool: ...
# PEP 646

View File

@ -1,8 +1,11 @@
from typing import Any, Awaitable, Callable
from typing import Awaitable, Callable
from typing_extensions import ParamSpec
from .case import TestCase
_P = ParamSpec("_P")
class IsolatedAsyncioTestCase(TestCase):
async def asyncSetUp(self) -> None: ...
async def asyncTearDown(self) -> None: ...
def addAsyncCleanup(self, __func: Callable[..., Awaitable[Any]], *args: Any, **kwargs: Any) -> None: ...
def addAsyncCleanup(self, __func: Callable[_P, Awaitable[object]], *args: _P.args, **kwargs: _P.kwargs) -> None: ...

View File

@ -22,6 +22,7 @@ from typing import (
TypeVar,
overload,
)
from typing_extensions import ParamSpec
from warnings import WarningMessage
if sys.version_info >= (3, 9):
@ -29,6 +30,7 @@ if sys.version_info >= (3, 9):
_E = TypeVar("_E", bound=BaseException)
_FT = TypeVar("_FT", bound=Callable[..., Any])
_P = ParamSpec("_P")
DIFF_OMITTED: str
@ -58,7 +60,7 @@ else:
) -> bool | None: ...
if sys.version_info >= (3, 8):
def addModuleCleanup(__function: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ...
def addModuleCleanup(__function: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs) -> None: ...
def doModuleCleanups() -> None: ...
def expectedFailure(test_item: _FT) -> _FT: ...
@ -106,11 +108,14 @@ class TestCase:
def assertGreaterEqual(self, a: Any, b: Any, msg: Any = ...) -> None: ...
def assertLess(self, a: Any, b: Any, msg: Any = ...) -> None: ...
def assertLessEqual(self, a: Any, b: Any, msg: Any = ...) -> None: ...
# `assertRaises`, `assertRaisesRegex`, and `assertRaisesRegexp`
# are not using `ParamSpec` intentionally,
# because they might be used with explicitly wrong arg types to raise some error in tests.
@overload
def assertRaises( # type: ignore[misc]
self,
expected_exception: type[BaseException] | tuple[type[BaseException], ...],
callable: Callable[..., Any],
callable: Callable[..., object],
*args: Any,
**kwargs: Any,
) -> None: ...
@ -121,7 +126,7 @@ class TestCase:
self,
expected_exception: type[BaseException] | tuple[type[BaseException], ...],
expected_regex: str | bytes | Pattern[str] | Pattern[bytes],
callable: Callable[..., Any],
callable: Callable[..., object],
*args: Any,
**kwargs: Any,
) -> None: ...
@ -134,7 +139,11 @@ class TestCase:
) -> _AssertRaisesContext[_E]: ...
@overload
def assertWarns( # type: ignore[misc]
self, expected_warning: type[Warning] | tuple[type[Warning], ...], callable: Callable[..., Any], *args: Any, **kwargs: Any
self,
expected_warning: type[Warning] | tuple[type[Warning], ...],
callable: Callable[_P, object],
*args: _P.args,
**kwargs: _P.kwargs,
) -> None: ...
@overload
def assertWarns(self, expected_warning: type[Warning] | tuple[type[Warning], ...], msg: Any = ...) -> _AssertWarnsContext: ...
@ -143,9 +152,9 @@ class TestCase:
self,
expected_warning: type[Warning] | tuple[type[Warning], ...],
expected_regex: str | bytes | Pattern[str] | Pattern[bytes],
callable: Callable[..., Any],
*args: Any,
**kwargs: Any,
callable: Callable[_P, object],
*args: _P.args,
**kwargs: _P.kwargs,
) -> None: ...
@overload
def assertWarnsRegex(
@ -207,13 +216,13 @@ class TestCase:
def id(self) -> str: ...
def shortDescription(self) -> str | None: ...
if sys.version_info >= (3, 8):
def addCleanup(self, __function: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ...
def addCleanup(self, __function: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs) -> None: ...
else:
def addCleanup(self, function: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ...
def addCleanup(self, function: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs) -> None: ...
def doCleanups(self) -> None: ...
if sys.version_info >= (3, 8):
@classmethod
def addClassCleanup(cls, __function: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ...
def addClassCleanup(cls, __function: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs) -> None: ...
@classmethod
def doClassCleanups(cls) -> None: ...
def _formatMessage(self, msg: str | None, standardMsg: str) -> str: ... # undocumented
@ -230,9 +239,9 @@ class TestCase:
def failUnlessRaises( # type: ignore[misc]
self,
exception: type[BaseException] | tuple[type[BaseException], ...],
callable: Callable[..., Any] = ...,
*args: Any,
**kwargs: Any,
callable: Callable[_P, object] = ...,
*args: _P.args,
**kwargs: _P.kwargs,
) -> None: ...
@overload
def failUnlessRaises(self, exception: type[_E] | tuple[type[_E], ...], msg: Any = ...) -> _AssertRaisesContext[_E]: ...
@ -251,7 +260,7 @@ class TestCase:
self,
exception: type[BaseException] | tuple[type[BaseException], ...],
expected_regex: str | bytes | Pattern[str] | Pattern[bytes],
callable: Callable[..., Any],
callable: Callable[..., object],
*args: Any,
**kwargs: Any,
) -> None: ...

View File

@ -25,14 +25,18 @@ _P = ParamSpec("_P")
ProxyTypes: tuple[type[Any], ...]
class WeakMethod(ref[_CallableT], Generic[_CallableT]):
def __new__(cls, meth: _CallableT, callback: Callable[[_CallableT], object] | None = ...) -> WeakMethod[_CallableT]: ...
def __new__(cls: type[Self], meth: _CallableT, callback: Callable[[_CallableT], object] | None = ...) -> Self: ...
def __call__(self) -> _CallableT | None: ...
class WeakValueDictionary(MutableMapping[_KT, _VT]):
@overload
def __init__(self) -> None: ...
@overload
def __init__(self, __other: Mapping[_KT, _VT] | Iterable[tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
def __init__(self: WeakValueDictionary[_KT, _VT], __other: Mapping[_KT, _VT] | Iterable[tuple[_KT, _VT]]) -> None: ...
@overload
def __init__(
self: WeakValueDictionary[str, _VT], __other: Mapping[str, _VT] | Iterable[tuple[str, _VT]] = ..., **kwargs: _VT
) -> None: ...
def __len__(self) -> int: ...
def __getitem__(self, k: _KT) -> _VT: ...
def __setitem__(self, k: _KT, v: _VT) -> None: ...
@ -63,7 +67,7 @@ class WeakValueDictionary(MutableMapping[_KT, _VT]):
class KeyedRef(ref[_T], Generic[_KT, _T]):
key: _KT
# This __new__ method uses a non-standard name for the "cls" parameter
def __new__(type, ob: _T, callback: Callable[[_T], Any], key: _KT) -> KeyedRef[_KT, _T]: ... # type: ignore
def __new__(type: type[Self], ob: _T, callback: Callable[[_T], Any], key: _KT) -> Self: ... # type: ignore
def __init__(self, ob: _T, callback: Callable[[_T], Any], key: _KT) -> None: ...
class WeakKeyDictionary(MutableMapping[_KT, _VT]):

View File

@ -16,7 +16,7 @@ from typing import (
Union,
overload,
)
from typing_extensions import Literal, SupportsIndex
from typing_extensions import Literal, SupportsIndex, TypeGuard
_T = TypeVar("_T")
_File = Union[StrOrBytesPath, FileDescriptor, IO[Any]]
@ -27,7 +27,8 @@ class ParseError(SyntaxError):
code: int
position: tuple[int, int]
def iselement(element: object) -> bool: ...
# In reality it works based on `.tag` attribute duck typing.
def iselement(element: object) -> TypeGuard[Element]: ...
if sys.version_info >= (3, 8):
@overload

View File

@ -1 +1 @@
from xml.etree.ElementTree import * # noqa: F403
from xml.etree.ElementTree import *

View File

@ -1,3 +1,4 @@
from _typeshed import Self
from socket import socket as _socket
from typing import Any, AnyStr, Generic, Mapping, TypeVar, overload
@ -195,6 +196,8 @@ class Connection(Generic[_C]):
def get_proto_info(self): ...
def get_server_info(self): ...
def show_warnings(self): ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, *exc_info: object) -> None: ...
Warning: Any
Error: Any
InterfaceError: Any

View File

@ -1,4 +1,5 @@
from typing import Any
from typing_extensions import Literal
class UnknownLocaleError(Exception):
identifier: Any
@ -108,3 +109,21 @@ def default_locale(category: Any | None = ..., aliases=...): ...
def negotiate_locale(preferred, available, sep: str = ..., aliases=...): ...
def parse_locale(identifier, sep: str = ...): ...
def get_locale_identifier(tup, sep: str = ...): ...
def get_global(key: _GLOBAL_KEY): ...
_GLOBAL_KEY = Literal[
"all_currencies",
"currency_fractions",
"language_aliases",
"likely_subtags",
"parent_exceptions",
"script_aliases",
"territory_aliases",
"territory_currencies",
"territory_languages",
"territory_zones",
"variant_aliases",
"windows_zone_mapping",
"zone_aliases",
"zone_territories",
]

View File

@ -1,10 +1,12 @@
import sys
from typing import Any, Callable, ClassVar, Generic, Iterator, Mapping, TypeVar
from typing_extensions import ParamSpec
if sys.version_info >= (3, 9):
from types import GenericAlias
_T = TypeVar("_T")
_P = ParamSpec("_P")
class ContextVar(Generic[_T]):
def __init__(self, name: str, *, default: _T = ...) -> None: ...
@ -31,8 +33,8 @@ def copy_context() -> Context: ...
# a different value.
class Context(Mapping[ContextVar[Any], Any]):
def __init__(self) -> None: ...
def run(self, callable: Callable[..., _T], *args: Any, **kwargs: Any) -> _T: ...
def run(self, callable: Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs) -> _T: ...
def copy(self) -> Context: ...
def __getitem__(self, key: ContextVar[Any]) -> Any: ...
def __getitem__(self, key: ContextVar[_T]) -> _T: ...
def __iter__(self) -> Iterator[ContextVar[Any]]: ...
def __len__(self) -> int: ...

View File

@ -1,9 +1,11 @@
import sys
from typing import Any, Callable, Iterator, NamedTuple, Pattern, Text, TypeVar
from typing_extensions import ParamSpec
_C = TypeVar("_C", bound=Callable[..., Any])
_Func = TypeVar("_Func", bound=Callable[..., Any])
_T = TypeVar("_T")
_P = ParamSpec("_P")
def get_init(cls: type) -> None: ...
@ -79,5 +81,5 @@ def decorator(
class ContextManager(_GeneratorContextManager[_T]):
def __call__(self, func: _C) -> _C: ...
def contextmanager(func: Callable[..., Iterator[_T]]) -> Callable[..., ContextManager[_T]]: ...
def contextmanager(func: Callable[_P, Iterator[_T]]) -> Callable[_P, ContextManager[_T]]: ...
def dispatch_on(*dispatch_args: Any) -> Callable[[Callable[..., Any]], Callable[..., Any]]: ...

View File

@ -1 +1 @@
version = "4.3.*"
version = "4.4.*"

View File

@ -1,14 +1,15 @@
from typing import Any, Generator, Iterable, Mapping, MutableMapping, Sized
from _typeshed import SupportsKeysAndGetItem
from typing import Any, Generator, Iterable, Iterator, Mapping, MutableMapping, Sized
class URIDict(MutableMapping[Any, Any]):
class URIDict(MutableMapping[str, str]):
def normalize(self, uri: str) -> str: ...
store: dict[Any, Any]
def __init__(self, *args, **kwargs) -> None: ...
def __getitem__(self, uri): ...
def __setitem__(self, uri, value) -> None: ...
def __delitem__(self, uri) -> None: ...
def __iter__(self): ...
def __len__(self): ...
store: dict[str, str]
def __init__(self, __m: SupportsKeysAndGetItem[str, str] | Iterable[tuple[str, str]], **kwargs: str) -> None: ...
def __getitem__(self, uri: str) -> str: ...
def __setitem__(self, uri: str, value: str) -> None: ...
def __delitem__(self, uri: str) -> None: ...
def __iter__(self) -> Iterator[str]: ...
def __len__(self) -> int: ...
class Unset: ...

View File

@ -1,28 +1,60 @@
from typing import Any, Callable
from _typeshed import SupportsKeysAndGetItem
from collections.abc import Callable, Generator, Iterable
from typing import Any, ClassVar
from ._utils import URIDict
_Schema = Any
# This class does not exist at runtime. Compatible classes are created at
# runtime by create().
class _Validator:
VALIDATORS: ClassVar[dict[Any, Any]]
META_SCHEMA: ClassVar[dict[Any, Any]]
TYPE_CHECKER: Any
@staticmethod
def ID_OF(schema: _Schema) -> str: ...
schema: Any
resolver: Any
format_checker: Any
evolve: Any
def __init__(self, schema: _Schema, resolver: Any | None = ..., format_checker: Any | None = ...) -> None: ...
@classmethod
def check_schema(cls, schema) -> None: ...
def iter_errors(self, instance, _schema: Any | None = ...) -> Generator[Any, None, None]: ...
def descend(self, instance, schema, path: Any | None = ..., schema_path: Any | None = ...) -> Generator[Any, None, None]: ...
def validate(self, *args, **kwargs) -> None: ...
def is_type(self, instance, type): ...
def is_valid(self, instance, _schema: Any | None = ...) -> bool: ...
def validates(version: str) -> Callable[..., Any]: ...
def create(meta_schema, validators=..., version: Any | None = ..., type_checker=..., id_of=..., applicable_validators=...): ...
def create(
meta_schema, validators=..., version: Any | None = ..., type_checker=..., id_of=..., applicable_validators=...
) -> type[_Validator]: ...
def extend(validator, validators=..., version: Any | None = ..., type_checker: Any | None = ...): ...
Draft3Validator: Any
Draft4Validator: Any
Draft6Validator: Any
Draft7Validator: Any
Draft201909Validator: Any
Draft202012Validator: Any
# At runtime these are fields that are assigned the return values of create() calls.
class Draft3Validator(_Validator): ...
class Draft4Validator(_Validator): ...
class Draft6Validator(_Validator): ...
class Draft7Validator(_Validator): ...
class Draft201909Validator(_Validator): ...
class Draft202012Validator(_Validator): ...
_Handler = Callable[[str], Any]
class RefResolver:
referrer: Any
referrer: str
cache_remote: Any
handlers: Any
store: Any
handlers: dict[str, _Handler]
store: URIDict
def __init__(
self,
base_uri,
referrer,
store=...,
base_uri: str,
referrer: str,
store: SupportsKeysAndGetItem[str, str] | Iterable[tuple[str, str]] = ...,
cache_remote: bool = ...,
handlers=...,
handlers: SupportsKeysAndGetItem[str, _Handler] | Iterable[tuple[str, _Handler]] = ...,
urljoin_cache: Any | None = ...,
remote_cache: Any | None = ...,
) -> None: ...
@ -41,5 +73,5 @@ class RefResolver:
def resolve_fragment(self, document, fragment): ...
def resolve_remote(self, uri): ...
def validate(instance, schema, cls: Any | None = ..., *args, **kwargs) -> None: ...
def validate(instance: object, schema: object, cls: type[_Validator] | None = ..., *args: Any, **kwargs: Any) -> None: ...
def validator_for(schema, default=...): ...

View File

@ -38,9 +38,10 @@ def KwArg(type: _T = ...) -> _T: ...
# Deprecated: Use typing.NoReturn instead.
class NoReturn: ...
# This is intended as a class decorator, but mypy rejects abstract classes
# when a Type[_T] is expected, so we can't give it the type we want
def trait(cls: Any) -> Any: ...
# This is consistent with implementation. Usage intends for this as
# a class decorator, but mypy does not support type[_T] for abstract
# classes until this issue is resolved, https://github.com/python/mypy/issues/4717.
def trait(cls: _T) -> _T: ...
def mypyc_attr(*attrs: str, **kwattrs: object) -> Callable[[_T], _T]: ...
class FlexibleAlias(Generic[_T, _U]): ...

View File

@ -0,0 +1 @@
version = "0.12.*"

View File

@ -0,0 +1,28 @@
import ast
from argparse import Namespace
from typing import Any, Generator
__version__: str
PYTHON_VERSION: tuple[int, int, int]
PY2: bool
CLASS_METHODS: frozenset[str]
METACLASS_BASES: frozenset[str]
METHOD_CONTAINER_NODES: set[ast.AST]
class NamingChecker:
name: str
version: str
visitors: Any
decorator_to_type: Any
ignore_names: frozenset[str]
parents: Any
def __init__(self, tree: ast.AST, filename: str) -> None: ...
@classmethod
def add_options(cls, parser: Any) -> None: ...
@classmethod
def parse_options(cls, option: Namespace) -> None: ...
def run(self) -> Generator[tuple[int, int, str, type[Any]], None, None]: ...
def __getattr__(self, name: str) -> Any: ... # incomplete (other attributes are normally not accessed)
def __getattr__(name: str) -> Any: ... # incomplete (other attributes are normally not accessed)

View File

@ -1,4 +1,4 @@
version = "3.19.*"
python2 = true
requires = ["types-futures"]
extra_description = "Generated with aid from mypy-protobuf v3.0.0"
extra_description = "Generated with aid from mypy-protobuf v3.2.0"

View File

@ -9,7 +9,7 @@ import google.protobuf.message
import typing
import typing_extensions
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor = ...
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
class Any(google.protobuf.message.Message, google.protobuf.internal.well_known_types.Any):
"""`Any` contains an arbitrary serialized protocol buffer message along with a
@ -95,10 +95,10 @@ class Any(google.protobuf.message.Message, google.protobuf.internal.well_known_t
"value": "1.212s"
}
"""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
TYPE_URL_FIELD_NUMBER: builtins.int
VALUE_FIELD_NUMBER: builtins.int
type_url: typing.Text = ...
type_url: typing.Text
"""A URL/resource name that uniquely identifies the type of the serialized
protocol buffer message. This string must contain at least
one "/" character. The last segment of the URL's path must represent
@ -128,13 +128,13 @@ class Any(google.protobuf.message.Message, google.protobuf.internal.well_known_t
used with implementation specific semantics.
"""
value: builtins.bytes = ...
value: builtins.bytes
"""Must be a valid serialized protocol buffer of the above specified type."""
def __init__(self,
*,
type_url : typing.Text = ...,
value : builtins.bytes = ...,
type_url: typing.Optional[typing.Text] = ...,
value: typing.Optional[builtins.bytes] = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["type_url",b"type_url","value",b"value"]) -> None: ...
global___Any = Any

View File

@ -11,7 +11,7 @@ import google.protobuf.type_pb2
import typing
import typing_extensions
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor = ...
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
class Api(google.protobuf.message.Message):
"""Api is a light-weight descriptor for an API Interface.
@ -24,7 +24,7 @@ class Api(google.protobuf.message.Message):
this message itself. See https://cloud.google.com/apis/design/glossary for
detailed terminology.
"""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
NAME_FIELD_NUMBER: builtins.int
METHODS_FIELD_NUMBER: builtins.int
OPTIONS_FIELD_NUMBER: builtins.int
@ -32,7 +32,7 @@ class Api(google.protobuf.message.Message):
SOURCE_CONTEXT_FIELD_NUMBER: builtins.int
MIXINS_FIELD_NUMBER: builtins.int
SYNTAX_FIELD_NUMBER: builtins.int
name: typing.Text = ...
name: typing.Text
"""The fully qualified name of this interface, including package name
followed by the interface's simple name.
"""
@ -45,7 +45,7 @@ class Api(google.protobuf.message.Message):
def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[google.protobuf.type_pb2.Option]:
"""Any metadata attached to the interface."""
pass
version: typing.Text = ...
version: typing.Text
"""A version string for this interface. If specified, must have the form
`major-version.minor-version`, as in `1.10`. If the minor version is
omitted, it defaults to zero. If the entire version field is empty, the
@ -77,18 +77,18 @@ class Api(google.protobuf.message.Message):
def mixins(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Mixin]:
"""Included interfaces. See [Mixin][]."""
pass
syntax: google.protobuf.type_pb2.Syntax.V = ...
syntax: google.protobuf.type_pb2.Syntax.ValueType
"""The source syntax of the service."""
def __init__(self,
*,
name : typing.Text = ...,
methods : typing.Optional[typing.Iterable[global___Method]] = ...,
options : typing.Optional[typing.Iterable[google.protobuf.type_pb2.Option]] = ...,
version : typing.Text = ...,
source_context : typing.Optional[google.protobuf.source_context_pb2.SourceContext] = ...,
mixins : typing.Optional[typing.Iterable[global___Mixin]] = ...,
syntax : google.protobuf.type_pb2.Syntax.V = ...,
name: typing.Optional[typing.Text] = ...,
methods: typing.Optional[typing.Iterable[global___Method]] = ...,
options: typing.Optional[typing.Iterable[google.protobuf.type_pb2.Option]] = ...,
version: typing.Optional[typing.Text] = ...,
source_context: typing.Optional[google.protobuf.source_context_pb2.SourceContext] = ...,
mixins: typing.Optional[typing.Iterable[global___Mixin]] = ...,
syntax: typing.Optional[google.protobuf.type_pb2.Syntax.ValueType] = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["source_context",b"source_context"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["methods",b"methods","mixins",b"mixins","name",b"name","options",b"options","source_context",b"source_context","syntax",b"syntax","version",b"version"]) -> None: ...
@ -96,7 +96,7 @@ global___Api = Api
class Method(google.protobuf.message.Message):
"""Method represents a method of an API interface."""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
NAME_FIELD_NUMBER: builtins.int
REQUEST_TYPE_URL_FIELD_NUMBER: builtins.int
REQUEST_STREAMING_FIELD_NUMBER: builtins.int
@ -104,37 +104,37 @@ class Method(google.protobuf.message.Message):
RESPONSE_STREAMING_FIELD_NUMBER: builtins.int
OPTIONS_FIELD_NUMBER: builtins.int
SYNTAX_FIELD_NUMBER: builtins.int
name: typing.Text = ...
name: typing.Text
"""The simple name of this method."""
request_type_url: typing.Text = ...
request_type_url: typing.Text
"""A URL of the input message type."""
request_streaming: builtins.bool = ...
request_streaming: builtins.bool
"""If true, the request is streamed."""
response_type_url: typing.Text = ...
response_type_url: typing.Text
"""The URL of the output message type."""
response_streaming: builtins.bool = ...
response_streaming: builtins.bool
"""If true, the response is streamed."""
@property
def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[google.protobuf.type_pb2.Option]:
"""Any metadata attached to the method."""
pass
syntax: google.protobuf.type_pb2.Syntax.V = ...
syntax: google.protobuf.type_pb2.Syntax.ValueType
"""The source syntax of this method."""
def __init__(self,
*,
name : typing.Text = ...,
request_type_url : typing.Text = ...,
request_streaming : builtins.bool = ...,
response_type_url : typing.Text = ...,
response_streaming : builtins.bool = ...,
options : typing.Optional[typing.Iterable[google.protobuf.type_pb2.Option]] = ...,
syntax : google.protobuf.type_pb2.Syntax.V = ...,
name: typing.Optional[typing.Text] = ...,
request_type_url: typing.Optional[typing.Text] = ...,
request_streaming: typing.Optional[builtins.bool] = ...,
response_type_url: typing.Optional[typing.Text] = ...,
response_streaming: typing.Optional[builtins.bool] = ...,
options: typing.Optional[typing.Iterable[google.protobuf.type_pb2.Option]] = ...,
syntax: typing.Optional[google.protobuf.type_pb2.Syntax.ValueType] = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["name",b"name","options",b"options","request_streaming",b"request_streaming","request_type_url",b"request_type_url","response_streaming",b"response_streaming","response_type_url",b"response_type_url","syntax",b"syntax"]) -> None: ...
global___Method = Method
@ -219,21 +219,21 @@ class Mixin(google.protobuf.message.Message):
...
}
"""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
NAME_FIELD_NUMBER: builtins.int
ROOT_FIELD_NUMBER: builtins.int
name: typing.Text = ...
name: typing.Text
"""The fully qualified name of the interface which is included."""
root: typing.Text = ...
root: typing.Text
"""If non-empty specifies a path under which inherited HTTP paths
are rooted.
"""
def __init__(self,
*,
name : typing.Text = ...,
root : typing.Text = ...,
name: typing.Optional[typing.Text] = ...,
root: typing.Optional[typing.Text] = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["name",b"name","root",b"root"]) -> None: ...
global___Mixin = Mixin

View File

@ -11,29 +11,29 @@ import google.protobuf.message
import typing
import typing_extensions
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor = ...
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
class Version(google.protobuf.message.Message):
"""The version number of protocol compiler."""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
MAJOR_FIELD_NUMBER: builtins.int
MINOR_FIELD_NUMBER: builtins.int
PATCH_FIELD_NUMBER: builtins.int
SUFFIX_FIELD_NUMBER: builtins.int
major: builtins.int = ...
minor: builtins.int = ...
patch: builtins.int = ...
suffix: typing.Text = ...
major: builtins.int
minor: builtins.int
patch: builtins.int
suffix: typing.Text
"""A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should
be empty for mainline stable releases.
"""
def __init__(self,
*,
major : typing.Optional[builtins.int] = ...,
minor : typing.Optional[builtins.int] = ...,
patch : typing.Optional[builtins.int] = ...,
suffix : typing.Optional[typing.Text] = ...,
major: typing.Optional[builtins.int] = ...,
minor: typing.Optional[builtins.int] = ...,
patch: typing.Optional[builtins.int] = ...,
suffix: typing.Optional[typing.Text] = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["major",b"major","minor",b"minor","patch",b"patch","suffix",b"suffix"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["major",b"major","minor",b"minor","patch",b"patch","suffix",b"suffix"]) -> None: ...
@ -41,7 +41,7 @@ global___Version = Version
class CodeGeneratorRequest(google.protobuf.message.Message):
"""An encoded CodeGeneratorRequest is written to the plugin's stdin."""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
FILE_TO_GENERATE_FIELD_NUMBER: builtins.int
PARAMETER_FIELD_NUMBER: builtins.int
PROTO_FILE_FIELD_NUMBER: builtins.int
@ -53,7 +53,7 @@ class CodeGeneratorRequest(google.protobuf.message.Message):
descriptor will be included in proto_file, below.
"""
pass
parameter: typing.Text = ...
parameter: typing.Text
"""The generator parameter passed on the command-line."""
@property
@ -80,10 +80,10 @@ class CodeGeneratorRequest(google.protobuf.message.Message):
pass
def __init__(self,
*,
file_to_generate : typing.Optional[typing.Iterable[typing.Text]] = ...,
parameter : typing.Optional[typing.Text] = ...,
proto_file : typing.Optional[typing.Iterable[google.protobuf.descriptor_pb2.FileDescriptorProto]] = ...,
compiler_version : typing.Optional[global___Version] = ...,
file_to_generate: typing.Optional[typing.Iterable[typing.Text]] = ...,
parameter: typing.Optional[typing.Text] = ...,
proto_file: typing.Optional[typing.Iterable[google.protobuf.descriptor_pb2.FileDescriptorProto]] = ...,
compiler_version: typing.Optional[global___Version] = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["compiler_version",b"compiler_version","parameter",b"parameter"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["compiler_version",b"compiler_version","file_to_generate",b"file_to_generate","parameter",b"parameter","proto_file",b"proto_file"]) -> None: ...
@ -91,28 +91,29 @@ global___CodeGeneratorRequest = CodeGeneratorRequest
class CodeGeneratorResponse(google.protobuf.message.Message):
"""The plugin writes an encoded CodeGeneratorResponse to stdout."""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
class _Feature:
ValueType = typing.NewType('ValueType', builtins.int)
V: typing_extensions.TypeAlias = ValueType
class _FeatureEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[CodeGeneratorResponse._Feature.ValueType], builtins.type):
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
FEATURE_NONE: CodeGeneratorResponse._Feature.ValueType # 0
FEATURE_PROTO3_OPTIONAL: CodeGeneratorResponse._Feature.ValueType # 1
class Feature(_Feature, metaclass=_FeatureEnumTypeWrapper):
"""Sync with code_generator.h."""
pass
class _Feature:
V = typing.NewType('V', builtins.int)
class _FeatureEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_Feature.V], builtins.type):
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor = ...
FEATURE_NONE = CodeGeneratorResponse.Feature.V(0)
FEATURE_PROTO3_OPTIONAL = CodeGeneratorResponse.Feature.V(1)
FEATURE_NONE = CodeGeneratorResponse.Feature.V(0)
FEATURE_PROTO3_OPTIONAL = CodeGeneratorResponse.Feature.V(1)
FEATURE_NONE: CodeGeneratorResponse.Feature.ValueType # 0
FEATURE_PROTO3_OPTIONAL: CodeGeneratorResponse.Feature.ValueType # 1
class File(google.protobuf.message.Message):
"""Represents a single generated file."""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
NAME_FIELD_NUMBER: builtins.int
INSERTION_POINT_FIELD_NUMBER: builtins.int
CONTENT_FIELD_NUMBER: builtins.int
GENERATED_CODE_INFO_FIELD_NUMBER: builtins.int
name: typing.Text = ...
name: typing.Text
"""The file name, relative to the output directory. The name must not
contain "." or ".." components and must be relative, not be absolute (so,
the file cannot lie outside the output directory). "/" must be used as
@ -126,7 +127,7 @@ class CodeGeneratorResponse(google.protobuf.message.Message):
CodeGeneratorResponse before writing files to disk.
"""
insertion_point: typing.Text = ...
insertion_point: typing.Text
"""If non-empty, indicates that the named file should already exist, and the
content here is to be inserted into that file at a defined insertion
point. This feature allows a code generator to extend the output
@ -166,7 +167,7 @@ class CodeGeneratorResponse(google.protobuf.message.Message):
If |insertion_point| is present, |name| must also be present.
"""
content: typing.Text = ...
content: typing.Text
"""The file contents."""
@property
@ -178,10 +179,10 @@ class CodeGeneratorResponse(google.protobuf.message.Message):
pass
def __init__(self,
*,
name : typing.Optional[typing.Text] = ...,
insertion_point : typing.Optional[typing.Text] = ...,
content : typing.Optional[typing.Text] = ...,
generated_code_info : typing.Optional[google.protobuf.descriptor_pb2.GeneratedCodeInfo] = ...,
name: typing.Optional[typing.Text] = ...,
insertion_point: typing.Optional[typing.Text] = ...,
content: typing.Optional[typing.Text] = ...,
generated_code_info: typing.Optional[google.protobuf.descriptor_pb2.GeneratedCodeInfo] = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["content",b"content","generated_code_info",b"generated_code_info","insertion_point",b"insertion_point","name",b"name"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["content",b"content","generated_code_info",b"generated_code_info","insertion_point",b"insertion_point","name",b"name"]) -> None: ...
@ -189,7 +190,7 @@ class CodeGeneratorResponse(google.protobuf.message.Message):
ERROR_FIELD_NUMBER: builtins.int
SUPPORTED_FEATURES_FIELD_NUMBER: builtins.int
FILE_FIELD_NUMBER: builtins.int
error: typing.Text = ...
error: typing.Text
"""Error message. If non-empty, code generation failed. The plugin process
should exit with status code zero even if it reports an error in this way.
@ -200,7 +201,7 @@ class CodeGeneratorResponse(google.protobuf.message.Message):
exiting with a non-zero status code.
"""
supported_features: builtins.int = ...
supported_features: builtins.int
"""A bitmask of supported features that the code generator supports.
This is a bitwise "or" of values from the Feature enum.
"""
@ -209,9 +210,9 @@ class CodeGeneratorResponse(google.protobuf.message.Message):
def file(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___CodeGeneratorResponse.File]: ...
def __init__(self,
*,
error : typing.Optional[typing.Text] = ...,
supported_features : typing.Optional[builtins.int] = ...,
file : typing.Optional[typing.Iterable[global___CodeGeneratorResponse.File]] = ...,
error: typing.Optional[typing.Text] = ...,
supported_features: typing.Optional[builtins.int] = ...,
file: typing.Optional[typing.Iterable[global___CodeGeneratorResponse.File]] = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["error",b"error","supported_features",b"supported_features"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["error",b"error","file",b"file","supported_features",b"supported_features"]) -> None: ...

View File

@ -6,9 +6,10 @@ import builtins
import google.protobuf.descriptor
import google.protobuf.internal.well_known_types
import google.protobuf.message
import typing
import typing_extensions
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor = ...
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
class Duration(google.protobuf.message.Message, google.protobuf.internal.well_known_types.Duration):
"""A Duration represents a signed, fixed-length span of time represented
@ -70,16 +71,16 @@ class Duration(google.protobuf.message.Message, google.protobuf.internal.well_kn
be expressed in JSON format as "3.000000001s", and 3 seconds and 1
microsecond should be expressed in JSON format as "3.000001s".
"""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
SECONDS_FIELD_NUMBER: builtins.int
NANOS_FIELD_NUMBER: builtins.int
seconds: builtins.int = ...
seconds: builtins.int
"""Signed seconds of the span of time. Must be from -315,576,000,000
to +315,576,000,000 inclusive. Note: these bounds are computed from:
60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
"""
nanos: builtins.int = ...
nanos: builtins.int
"""Signed fractions of a second at nanosecond resolution of the span
of time. Durations less than one second are represented with a 0
`seconds` field and a positive or negative `nanos` field. For durations
@ -90,8 +91,8 @@ class Duration(google.protobuf.message.Message, google.protobuf.internal.well_kn
def __init__(self,
*,
seconds : builtins.int = ...,
nanos : builtins.int = ...,
seconds: typing.Optional[builtins.int] = ...,
nanos: typing.Optional[builtins.int] = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["nanos",b"nanos","seconds",b"seconds"]) -> None: ...
global___Duration = Duration

View File

@ -5,7 +5,7 @@ isort:skip_file
import google.protobuf.descriptor
import google.protobuf.message
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor = ...
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
class Empty(google.protobuf.message.Message):
"""A generic empty message that you can re-use to avoid defining duplicated
@ -18,7 +18,7 @@ class Empty(google.protobuf.message.Message):
The JSON representation for `Empty` is empty JSON object `{}`.
"""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
def __init__(self,
) -> None: ...
global___Empty = Empty

View File

@ -10,7 +10,7 @@ import google.protobuf.message
import typing
import typing_extensions
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor = ...
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
class FieldMask(google.protobuf.message.Message, google.protobuf.internal.well_known_types.FieldMask):
"""`FieldMask` represents a set of symbolic field paths, for example:
@ -213,7 +213,7 @@ class FieldMask(google.protobuf.message.Message, google.protobuf.internal.well_k
request should verify the included field paths, and return an
`INVALID_ARGUMENT` error if any path is unmappable.
"""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
PATHS_FIELD_NUMBER: builtins.int
@property
def paths(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]:
@ -221,7 +221,7 @@ class FieldMask(google.protobuf.message.Message, google.protobuf.internal.well_k
pass
def __init__(self,
*,
paths : typing.Optional[typing.Iterable[typing.Text]] = ...,
paths: typing.Optional[typing.Iterable[typing.Text]] = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["paths",b"paths"]) -> None: ...
global___FieldMask = FieldMask

View File

@ -8,22 +8,22 @@ import google.protobuf.message
import typing
import typing_extensions
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor = ...
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
class SourceContext(google.protobuf.message.Message):
"""`SourceContext` represents information about the source of a
protobuf element, like the file in which it is defined.
"""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
FILE_NAME_FIELD_NUMBER: builtins.int
file_name: typing.Text = ...
file_name: typing.Text
"""The path-qualified name of the .proto file that contained the associated
protobuf element. For example: `"google/protobuf/source_context.proto"`.
"""
def __init__(self,
*,
file_name : typing.Text = ...,
file_name: typing.Optional[typing.Text] = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["file_name",b"file_name"]) -> None: ...
global___SourceContext = SourceContext

View File

@ -11,7 +11,15 @@ import google.protobuf.message
import typing
import typing_extensions
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor = ...
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
class _NullValue:
ValueType = typing.NewType('ValueType', builtins.int)
V: typing_extensions.TypeAlias = ValueType
class _NullValueEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_NullValue.ValueType], builtins.type):
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
NULL_VALUE: _NullValue.ValueType # 0
"""Null value."""
class NullValue(_NullValue, metaclass=_NullValueEnumTypeWrapper):
"""`NullValue` is a singleton enumeration to represent the null value for the
@ -20,15 +28,8 @@ class NullValue(_NullValue, metaclass=_NullValueEnumTypeWrapper):
The JSON representation for `NullValue` is JSON `null`.
"""
pass
class _NullValue:
V = typing.NewType('V', builtins.int)
class _NullValueEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_NullValue.V], builtins.type):
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor = ...
NULL_VALUE = NullValue.V(0)
"""Null value."""
NULL_VALUE = NullValue.V(0)
NULL_VALUE: NullValue.ValueType # 0
"""Null value."""
global___NullValue = NullValue
@ -44,18 +45,18 @@ class Struct(google.protobuf.message.Message, google.protobuf.internal.well_know
The JSON representation for `Struct` is JSON object.
"""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
class FieldsEntry(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
KEY_FIELD_NUMBER: builtins.int
VALUE_FIELD_NUMBER: builtins.int
key: typing.Text = ...
key: typing.Text
@property
def value(self) -> global___Value: ...
def __init__(self,
*,
key : typing.Text = ...,
value : typing.Optional[global___Value] = ...,
key: typing.Optional[typing.Text] = ...,
value: typing.Optional[global___Value] = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["value",b"value"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["key",b"key","value",b"value"]) -> None: ...
@ -67,7 +68,7 @@ class Struct(google.protobuf.message.Message, google.protobuf.internal.well_know
pass
def __init__(self,
*,
fields : typing.Optional[typing.Mapping[typing.Text, global___Value]] = ...,
fields: typing.Optional[typing.Mapping[typing.Text, global___Value]] = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["fields",b"fields"]) -> None: ...
global___Struct = Struct
@ -80,23 +81,23 @@ class Value(google.protobuf.message.Message):
The JSON representation for `Value` is JSON value.
"""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
NULL_VALUE_FIELD_NUMBER: builtins.int
NUMBER_VALUE_FIELD_NUMBER: builtins.int
STRING_VALUE_FIELD_NUMBER: builtins.int
BOOL_VALUE_FIELD_NUMBER: builtins.int
STRUCT_VALUE_FIELD_NUMBER: builtins.int
LIST_VALUE_FIELD_NUMBER: builtins.int
null_value: global___NullValue.V = ...
null_value: global___NullValue.ValueType
"""Represents a null value."""
number_value: builtins.float = ...
number_value: builtins.float
"""Represents a double value."""
string_value: typing.Text = ...
string_value: typing.Text
"""Represents a string value."""
bool_value: builtins.bool = ...
bool_value: builtins.bool
"""Represents a boolean value."""
@property
@ -109,12 +110,12 @@ class Value(google.protobuf.message.Message):
pass
def __init__(self,
*,
null_value : global___NullValue.V = ...,
number_value : builtins.float = ...,
string_value : typing.Text = ...,
bool_value : builtins.bool = ...,
struct_value : typing.Optional[global___Struct] = ...,
list_value : typing.Optional[global___ListValue] = ...,
null_value: typing.Optional[global___NullValue.ValueType] = ...,
number_value: typing.Optional[builtins.float] = ...,
string_value: typing.Optional[typing.Text] = ...,
bool_value: typing.Optional[builtins.bool] = ...,
struct_value: typing.Optional[global___Struct] = ...,
list_value: typing.Optional[global___ListValue] = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["bool_value",b"bool_value","kind",b"kind","list_value",b"list_value","null_value",b"null_value","number_value",b"number_value","string_value",b"string_value","struct_value",b"struct_value"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["bool_value",b"bool_value","kind",b"kind","list_value",b"list_value","null_value",b"null_value","number_value",b"number_value","string_value",b"string_value","struct_value",b"struct_value"]) -> None: ...
@ -126,7 +127,7 @@ class ListValue(google.protobuf.message.Message, google.protobuf.internal.well_k
The JSON representation for `ListValue` is JSON array.
"""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
VALUES_FIELD_NUMBER: builtins.int
@property
def values(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Value]:
@ -134,7 +135,7 @@ class ListValue(google.protobuf.message.Message, google.protobuf.internal.well_k
pass
def __init__(self,
*,
values : typing.Optional[typing.Iterable[global___Value]] = ...,
values: typing.Optional[typing.Iterable[global___Value]] = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["values",b"values"]) -> None: ...
global___ListValue = ListValue

View File

@ -6,9 +6,10 @@ import builtins
import google.protobuf.descriptor
import google.protobuf.internal.well_known_types
import google.protobuf.message
import typing
import typing_extensions
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor = ...
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
class Timestamp(google.protobuf.message.Message, google.protobuf.internal.well_known_types.Timestamp):
"""A Timestamp represents a point in time independent of any time zone or local
@ -103,16 +104,16 @@ class Timestamp(google.protobuf.message.Message, google.protobuf.internal.well_k
http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
) to obtain a formatter capable of generating timestamps in this format.
"""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
SECONDS_FIELD_NUMBER: builtins.int
NANOS_FIELD_NUMBER: builtins.int
seconds: builtins.int = ...
seconds: builtins.int
"""Represents seconds of UTC time since Unix epoch
1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
9999-12-31T23:59:59Z inclusive.
"""
nanos: builtins.int = ...
nanos: builtins.int
"""Non-negative fractions of a second at nanosecond resolution. Negative
second values with fractions must still have non-negative nanos values
that count forward in time. Must be from 0 to 999,999,999
@ -121,8 +122,8 @@ class Timestamp(google.protobuf.message.Message, google.protobuf.internal.well_k
def __init__(self,
*,
seconds : builtins.int = ...,
nanos : builtins.int = ...,
seconds: typing.Optional[builtins.int] = ...,
nanos: typing.Optional[builtins.int] = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["nanos",b"nanos","seconds",b"seconds"]) -> None: ...
global___Timestamp = Timestamp

View File

@ -12,26 +12,27 @@ import google.protobuf.source_context_pb2
import typing
import typing_extensions
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor = ...
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
class _Syntax:
ValueType = typing.NewType('ValueType', builtins.int)
V: typing_extensions.TypeAlias = ValueType
class _SyntaxEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_Syntax.ValueType], builtins.type):
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
SYNTAX_PROTO2: _Syntax.ValueType # 0
"""Syntax `proto2`."""
SYNTAX_PROTO3: _Syntax.ValueType # 1
"""Syntax `proto3`."""
class Syntax(_Syntax, metaclass=_SyntaxEnumTypeWrapper):
"""The syntax in which a protocol buffer element is defined."""
pass
class _Syntax:
V = typing.NewType('V', builtins.int)
class _SyntaxEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_Syntax.V], builtins.type):
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor = ...
SYNTAX_PROTO2 = Syntax.V(0)
"""Syntax `proto2`."""
SYNTAX_PROTO3 = Syntax.V(1)
"""Syntax `proto3`."""
SYNTAX_PROTO2 = Syntax.V(0)
SYNTAX_PROTO2: Syntax.ValueType # 0
"""Syntax `proto2`."""
SYNTAX_PROTO3 = Syntax.V(1)
SYNTAX_PROTO3: Syntax.ValueType # 1
"""Syntax `proto3`."""
global___Syntax = Syntax
@ -39,14 +40,14 @@ global___Syntax = Syntax
class Type(google.protobuf.message.Message):
"""A protocol buffer message type."""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
NAME_FIELD_NUMBER: builtins.int
FIELDS_FIELD_NUMBER: builtins.int
ONEOFS_FIELD_NUMBER: builtins.int
OPTIONS_FIELD_NUMBER: builtins.int
SOURCE_CONTEXT_FIELD_NUMBER: builtins.int
SYNTAX_FIELD_NUMBER: builtins.int
name: typing.Text = ...
name: typing.Text
"""The fully qualified message name."""
@property
@ -65,17 +66,17 @@ class Type(google.protobuf.message.Message):
def source_context(self) -> google.protobuf.source_context_pb2.SourceContext:
"""The source context."""
pass
syntax: global___Syntax.V = ...
syntax: global___Syntax.ValueType
"""The source syntax."""
def __init__(self,
*,
name : typing.Text = ...,
fields : typing.Optional[typing.Iterable[global___Field]] = ...,
oneofs : typing.Optional[typing.Iterable[typing.Text]] = ...,
options : typing.Optional[typing.Iterable[global___Option]] = ...,
source_context : typing.Optional[google.protobuf.source_context_pb2.SourceContext] = ...,
syntax : global___Syntax.V = ...,
name: typing.Optional[typing.Text] = ...,
fields: typing.Optional[typing.Iterable[global___Field]] = ...,
oneofs: typing.Optional[typing.Iterable[typing.Text]] = ...,
options: typing.Optional[typing.Iterable[global___Option]] = ...,
source_context: typing.Optional[google.protobuf.source_context_pb2.SourceContext] = ...,
syntax: typing.Optional[global___Syntax.ValueType] = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["source_context",b"source_context"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["fields",b"fields","name",b"name","oneofs",b"oneofs","options",b"options","source_context",b"source_context","syntax",b"syntax"]) -> None: ...
@ -83,160 +84,162 @@ global___Type = Type
class Field(google.protobuf.message.Message):
"""A single field of a message type."""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
class _Kind:
ValueType = typing.NewType('ValueType', builtins.int)
V: typing_extensions.TypeAlias = ValueType
class _KindEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Field._Kind.ValueType], builtins.type):
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
TYPE_UNKNOWN: Field._Kind.ValueType # 0
"""Field type unknown."""
TYPE_DOUBLE: Field._Kind.ValueType # 1
"""Field type double."""
TYPE_FLOAT: Field._Kind.ValueType # 2
"""Field type float."""
TYPE_INT64: Field._Kind.ValueType # 3
"""Field type int64."""
TYPE_UINT64: Field._Kind.ValueType # 4
"""Field type uint64."""
TYPE_INT32: Field._Kind.ValueType # 5
"""Field type int32."""
TYPE_FIXED64: Field._Kind.ValueType # 6
"""Field type fixed64."""
TYPE_FIXED32: Field._Kind.ValueType # 7
"""Field type fixed32."""
TYPE_BOOL: Field._Kind.ValueType # 8
"""Field type bool."""
TYPE_STRING: Field._Kind.ValueType # 9
"""Field type string."""
TYPE_GROUP: Field._Kind.ValueType # 10
"""Field type group. Proto2 syntax only, and deprecated."""
TYPE_MESSAGE: Field._Kind.ValueType # 11
"""Field type message."""
TYPE_BYTES: Field._Kind.ValueType # 12
"""Field type bytes."""
TYPE_UINT32: Field._Kind.ValueType # 13
"""Field type uint32."""
TYPE_ENUM: Field._Kind.ValueType # 14
"""Field type enum."""
TYPE_SFIXED32: Field._Kind.ValueType # 15
"""Field type sfixed32."""
TYPE_SFIXED64: Field._Kind.ValueType # 16
"""Field type sfixed64."""
TYPE_SINT32: Field._Kind.ValueType # 17
"""Field type sint32."""
TYPE_SINT64: Field._Kind.ValueType # 18
"""Field type sint64."""
class Kind(_Kind, metaclass=_KindEnumTypeWrapper):
"""Basic field types."""
pass
class _Kind:
V = typing.NewType('V', builtins.int)
class _KindEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_Kind.V], builtins.type):
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor = ...
TYPE_UNKNOWN = Field.Kind.V(0)
"""Field type unknown."""
TYPE_DOUBLE = Field.Kind.V(1)
"""Field type double."""
TYPE_FLOAT = Field.Kind.V(2)
"""Field type float."""
TYPE_INT64 = Field.Kind.V(3)
"""Field type int64."""
TYPE_UINT64 = Field.Kind.V(4)
"""Field type uint64."""
TYPE_INT32 = Field.Kind.V(5)
"""Field type int32."""
TYPE_FIXED64 = Field.Kind.V(6)
"""Field type fixed64."""
TYPE_FIXED32 = Field.Kind.V(7)
"""Field type fixed32."""
TYPE_BOOL = Field.Kind.V(8)
"""Field type bool."""
TYPE_STRING = Field.Kind.V(9)
"""Field type string."""
TYPE_GROUP = Field.Kind.V(10)
"""Field type group. Proto2 syntax only, and deprecated."""
TYPE_MESSAGE = Field.Kind.V(11)
"""Field type message."""
TYPE_BYTES = Field.Kind.V(12)
"""Field type bytes."""
TYPE_UINT32 = Field.Kind.V(13)
"""Field type uint32."""
TYPE_ENUM = Field.Kind.V(14)
"""Field type enum."""
TYPE_SFIXED32 = Field.Kind.V(15)
"""Field type sfixed32."""
TYPE_SFIXED64 = Field.Kind.V(16)
"""Field type sfixed64."""
TYPE_SINT32 = Field.Kind.V(17)
"""Field type sint32."""
TYPE_SINT64 = Field.Kind.V(18)
"""Field type sint64."""
TYPE_UNKNOWN = Field.Kind.V(0)
TYPE_UNKNOWN: Field.Kind.ValueType # 0
"""Field type unknown."""
TYPE_DOUBLE = Field.Kind.V(1)
TYPE_DOUBLE: Field.Kind.ValueType # 1
"""Field type double."""
TYPE_FLOAT = Field.Kind.V(2)
TYPE_FLOAT: Field.Kind.ValueType # 2
"""Field type float."""
TYPE_INT64 = Field.Kind.V(3)
TYPE_INT64: Field.Kind.ValueType # 3
"""Field type int64."""
TYPE_UINT64 = Field.Kind.V(4)
TYPE_UINT64: Field.Kind.ValueType # 4
"""Field type uint64."""
TYPE_INT32 = Field.Kind.V(5)
TYPE_INT32: Field.Kind.ValueType # 5
"""Field type int32."""
TYPE_FIXED64 = Field.Kind.V(6)
TYPE_FIXED64: Field.Kind.ValueType # 6
"""Field type fixed64."""
TYPE_FIXED32 = Field.Kind.V(7)
TYPE_FIXED32: Field.Kind.ValueType # 7
"""Field type fixed32."""
TYPE_BOOL = Field.Kind.V(8)
TYPE_BOOL: Field.Kind.ValueType # 8
"""Field type bool."""
TYPE_STRING = Field.Kind.V(9)
TYPE_STRING: Field.Kind.ValueType # 9
"""Field type string."""
TYPE_GROUP = Field.Kind.V(10)
TYPE_GROUP: Field.Kind.ValueType # 10
"""Field type group. Proto2 syntax only, and deprecated."""
TYPE_MESSAGE = Field.Kind.V(11)
TYPE_MESSAGE: Field.Kind.ValueType # 11
"""Field type message."""
TYPE_BYTES = Field.Kind.V(12)
TYPE_BYTES: Field.Kind.ValueType # 12
"""Field type bytes."""
TYPE_UINT32 = Field.Kind.V(13)
TYPE_UINT32: Field.Kind.ValueType # 13
"""Field type uint32."""
TYPE_ENUM = Field.Kind.V(14)
TYPE_ENUM: Field.Kind.ValueType # 14
"""Field type enum."""
TYPE_SFIXED32 = Field.Kind.V(15)
TYPE_SFIXED32: Field.Kind.ValueType # 15
"""Field type sfixed32."""
TYPE_SFIXED64 = Field.Kind.V(16)
TYPE_SFIXED64: Field.Kind.ValueType # 16
"""Field type sfixed64."""
TYPE_SINT32 = Field.Kind.V(17)
TYPE_SINT32: Field.Kind.ValueType # 17
"""Field type sint32."""
TYPE_SINT64 = Field.Kind.V(18)
TYPE_SINT64: Field.Kind.ValueType # 18
"""Field type sint64."""
class _Cardinality:
ValueType = typing.NewType('ValueType', builtins.int)
V: typing_extensions.TypeAlias = ValueType
class _CardinalityEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Field._Cardinality.ValueType], builtins.type):
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
CARDINALITY_UNKNOWN: Field._Cardinality.ValueType # 0
"""For fields with unknown cardinality."""
CARDINALITY_OPTIONAL: Field._Cardinality.ValueType # 1
"""For optional fields."""
CARDINALITY_REQUIRED: Field._Cardinality.ValueType # 2
"""For required fields. Proto2 syntax only."""
CARDINALITY_REPEATED: Field._Cardinality.ValueType # 3
"""For repeated fields."""
class Cardinality(_Cardinality, metaclass=_CardinalityEnumTypeWrapper):
"""Whether a field is optional, required, or repeated."""
pass
class _Cardinality:
V = typing.NewType('V', builtins.int)
class _CardinalityEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_Cardinality.V], builtins.type):
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor = ...
CARDINALITY_UNKNOWN = Field.Cardinality.V(0)
"""For fields with unknown cardinality."""
CARDINALITY_OPTIONAL = Field.Cardinality.V(1)
"""For optional fields."""
CARDINALITY_REQUIRED = Field.Cardinality.V(2)
"""For required fields. Proto2 syntax only."""
CARDINALITY_REPEATED = Field.Cardinality.V(3)
"""For repeated fields."""
CARDINALITY_UNKNOWN = Field.Cardinality.V(0)
CARDINALITY_UNKNOWN: Field.Cardinality.ValueType # 0
"""For fields with unknown cardinality."""
CARDINALITY_OPTIONAL = Field.Cardinality.V(1)
CARDINALITY_OPTIONAL: Field.Cardinality.ValueType # 1
"""For optional fields."""
CARDINALITY_REQUIRED = Field.Cardinality.V(2)
CARDINALITY_REQUIRED: Field.Cardinality.ValueType # 2
"""For required fields. Proto2 syntax only."""
CARDINALITY_REPEATED = Field.Cardinality.V(3)
CARDINALITY_REPEATED: Field.Cardinality.ValueType # 3
"""For repeated fields."""
@ -250,66 +253,66 @@ class Field(google.protobuf.message.Message):
OPTIONS_FIELD_NUMBER: builtins.int
JSON_NAME_FIELD_NUMBER: builtins.int
DEFAULT_VALUE_FIELD_NUMBER: builtins.int
kind: global___Field.Kind.V = ...
kind: global___Field.Kind.ValueType
"""The field type."""
cardinality: global___Field.Cardinality.V = ...
cardinality: global___Field.Cardinality.ValueType
"""The field cardinality."""
number: builtins.int = ...
number: builtins.int
"""The field number."""
name: typing.Text = ...
name: typing.Text
"""The field name."""
type_url: typing.Text = ...
type_url: typing.Text
"""The field type URL, without the scheme, for message or enumeration
types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
"""
oneof_index: builtins.int = ...
oneof_index: builtins.int
"""The index of the field type in `Type.oneofs`, for message or enumeration
types. The first type has index 1; zero means the type is not in the list.
"""
packed: builtins.bool = ...
packed: builtins.bool
"""Whether to use alternative packed wire representation."""
@property
def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Option]:
"""The protocol buffer options."""
pass
json_name: typing.Text = ...
json_name: typing.Text
"""The field JSON name."""
default_value: typing.Text = ...
default_value: typing.Text
"""The string value of the default value of this field. Proto2 syntax only."""
def __init__(self,
*,
kind : global___Field.Kind.V = ...,
cardinality : global___Field.Cardinality.V = ...,
number : builtins.int = ...,
name : typing.Text = ...,
type_url : typing.Text = ...,
oneof_index : builtins.int = ...,
packed : builtins.bool = ...,
options : typing.Optional[typing.Iterable[global___Option]] = ...,
json_name : typing.Text = ...,
default_value : typing.Text = ...,
kind: typing.Optional[global___Field.Kind.ValueType] = ...,
cardinality: typing.Optional[global___Field.Cardinality.ValueType] = ...,
number: typing.Optional[builtins.int] = ...,
name: typing.Optional[typing.Text] = ...,
type_url: typing.Optional[typing.Text] = ...,
oneof_index: typing.Optional[builtins.int] = ...,
packed: typing.Optional[builtins.bool] = ...,
options: typing.Optional[typing.Iterable[global___Option]] = ...,
json_name: typing.Optional[typing.Text] = ...,
default_value: typing.Optional[typing.Text] = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["cardinality",b"cardinality","default_value",b"default_value","json_name",b"json_name","kind",b"kind","name",b"name","number",b"number","oneof_index",b"oneof_index","options",b"options","packed",b"packed","type_url",b"type_url"]) -> None: ...
global___Field = Field
class Enum(google.protobuf.message.Message):
"""Enum type definition."""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
NAME_FIELD_NUMBER: builtins.int
ENUMVALUE_FIELD_NUMBER: builtins.int
OPTIONS_FIELD_NUMBER: builtins.int
SOURCE_CONTEXT_FIELD_NUMBER: builtins.int
SYNTAX_FIELD_NUMBER: builtins.int
name: typing.Text = ...
name: typing.Text
"""Enum type name."""
@property
@ -324,16 +327,16 @@ class Enum(google.protobuf.message.Message):
def source_context(self) -> google.protobuf.source_context_pb2.SourceContext:
"""The source context."""
pass
syntax: global___Syntax.V = ...
syntax: global___Syntax.ValueType
"""The source syntax."""
def __init__(self,
*,
name : typing.Text = ...,
enumvalue : typing.Optional[typing.Iterable[global___EnumValue]] = ...,
options : typing.Optional[typing.Iterable[global___Option]] = ...,
source_context : typing.Optional[google.protobuf.source_context_pb2.SourceContext] = ...,
syntax : global___Syntax.V = ...,
name: typing.Optional[typing.Text] = ...,
enumvalue: typing.Optional[typing.Iterable[global___EnumValue]] = ...,
options: typing.Optional[typing.Iterable[global___Option]] = ...,
source_context: typing.Optional[google.protobuf.source_context_pb2.SourceContext] = ...,
syntax: typing.Optional[global___Syntax.ValueType] = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["source_context",b"source_context"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["enumvalue",b"enumvalue","name",b"name","options",b"options","source_context",b"source_context","syntax",b"syntax"]) -> None: ...
@ -341,14 +344,14 @@ global___Enum = Enum
class EnumValue(google.protobuf.message.Message):
"""Enum value definition."""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
NAME_FIELD_NUMBER: builtins.int
NUMBER_FIELD_NUMBER: builtins.int
OPTIONS_FIELD_NUMBER: builtins.int
name: typing.Text = ...
name: typing.Text
"""Enum value name."""
number: builtins.int = ...
number: builtins.int
"""Enum value number."""
@property
@ -357,9 +360,9 @@ class EnumValue(google.protobuf.message.Message):
pass
def __init__(self,
*,
name : typing.Text = ...,
number : builtins.int = ...,
options : typing.Optional[typing.Iterable[global___Option]] = ...,
name: typing.Optional[typing.Text] = ...,
number: typing.Optional[builtins.int] = ...,
options: typing.Optional[typing.Iterable[global___Option]] = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["name",b"name","number",b"number","options",b"options"]) -> None: ...
global___EnumValue = EnumValue
@ -368,10 +371,10 @@ class Option(google.protobuf.message.Message):
"""A protocol buffer option, which can be attached to a message, field,
enumeration, etc.
"""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
NAME_FIELD_NUMBER: builtins.int
VALUE_FIELD_NUMBER: builtins.int
name: typing.Text = ...
name: typing.Text
"""The option's name. For protobuf built-in options (options defined in
descriptor.proto), this is the short name. For example, `"map_entry"`.
For custom options, it should be the fully-qualified name. For example,
@ -388,8 +391,8 @@ class Option(google.protobuf.message.Message):
pass
def __init__(self,
*,
name : typing.Text = ...,
value : typing.Optional[google.protobuf.any_pb2.Any] = ...,
name: typing.Optional[typing.Text] = ...,
value: typing.Optional[google.protobuf.any_pb2.Any] = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["value",b"value"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["name",b"name","value",b"value"]) -> None: ...

View File

@ -8,21 +8,21 @@ import google.protobuf.message
import typing
import typing_extensions
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor = ...
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
class DoubleValue(google.protobuf.message.Message):
"""Wrapper message for `double`.
The JSON representation for `DoubleValue` is JSON number.
"""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
VALUE_FIELD_NUMBER: builtins.int
value: builtins.float = ...
value: builtins.float
"""The double value."""
def __init__(self,
*,
value : builtins.float = ...,
value: typing.Optional[builtins.float] = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["value",b"value"]) -> None: ...
global___DoubleValue = DoubleValue
@ -32,14 +32,14 @@ class FloatValue(google.protobuf.message.Message):
The JSON representation for `FloatValue` is JSON number.
"""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
VALUE_FIELD_NUMBER: builtins.int
value: builtins.float = ...
value: builtins.float
"""The float value."""
def __init__(self,
*,
value : builtins.float = ...,
value: typing.Optional[builtins.float] = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["value",b"value"]) -> None: ...
global___FloatValue = FloatValue
@ -49,14 +49,14 @@ class Int64Value(google.protobuf.message.Message):
The JSON representation for `Int64Value` is JSON string.
"""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
VALUE_FIELD_NUMBER: builtins.int
value: builtins.int = ...
value: builtins.int
"""The int64 value."""
def __init__(self,
*,
value : builtins.int = ...,
value: typing.Optional[builtins.int] = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["value",b"value"]) -> None: ...
global___Int64Value = Int64Value
@ -66,14 +66,14 @@ class UInt64Value(google.protobuf.message.Message):
The JSON representation for `UInt64Value` is JSON string.
"""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
VALUE_FIELD_NUMBER: builtins.int
value: builtins.int = ...
value: builtins.int
"""The uint64 value."""
def __init__(self,
*,
value : builtins.int = ...,
value: typing.Optional[builtins.int] = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["value",b"value"]) -> None: ...
global___UInt64Value = UInt64Value
@ -83,14 +83,14 @@ class Int32Value(google.protobuf.message.Message):
The JSON representation for `Int32Value` is JSON number.
"""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
VALUE_FIELD_NUMBER: builtins.int
value: builtins.int = ...
value: builtins.int
"""The int32 value."""
def __init__(self,
*,
value : builtins.int = ...,
value: typing.Optional[builtins.int] = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["value",b"value"]) -> None: ...
global___Int32Value = Int32Value
@ -100,14 +100,14 @@ class UInt32Value(google.protobuf.message.Message):
The JSON representation for `UInt32Value` is JSON number.
"""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
VALUE_FIELD_NUMBER: builtins.int
value: builtins.int = ...
value: builtins.int
"""The uint32 value."""
def __init__(self,
*,
value : builtins.int = ...,
value: typing.Optional[builtins.int] = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["value",b"value"]) -> None: ...
global___UInt32Value = UInt32Value
@ -117,14 +117,14 @@ class BoolValue(google.protobuf.message.Message):
The JSON representation for `BoolValue` is JSON `true` and `false`.
"""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
VALUE_FIELD_NUMBER: builtins.int
value: builtins.bool = ...
value: builtins.bool
"""The bool value."""
def __init__(self,
*,
value : builtins.bool = ...,
value: typing.Optional[builtins.bool] = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["value",b"value"]) -> None: ...
global___BoolValue = BoolValue
@ -134,14 +134,14 @@ class StringValue(google.protobuf.message.Message):
The JSON representation for `StringValue` is JSON string.
"""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
VALUE_FIELD_NUMBER: builtins.int
value: typing.Text = ...
value: typing.Text
"""The string value."""
def __init__(self,
*,
value : typing.Text = ...,
value: typing.Optional[typing.Text] = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["value",b"value"]) -> None: ...
global___StringValue = StringValue
@ -151,14 +151,14 @@ class BytesValue(google.protobuf.message.Message):
The JSON representation for `BytesValue` is JSON string.
"""
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
DESCRIPTOR: google.protobuf.descriptor.Descriptor
VALUE_FIELD_NUMBER: builtins.int
value: builtins.bytes = ...
value: builtins.bytes
"""The bytes value."""
def __init__(self,
*,
value : builtins.bytes = ...,
value: typing.Optional[builtins.bytes] = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["value",b"value"]) -> None: ...
global___BytesValue = BytesValue

View File

@ -100,11 +100,11 @@ class Flag:
value: Any
help: str
short_name: str
boolean = False
present = False
boolean: bool
present: bool
parser: ArgumentParser
serializer: ArgumentSerializer
allow_override = False
allow_override: bool
def __init__(
self,
parser: ArgumentParser,

View File

@ -104,7 +104,7 @@ class Connection:
def set_parser(self, parser_class): ...
def connect(self): ...
def on_connect(self): ...
def disconnect(self): ...
def disconnect(self, *args: object) -> None: ... # 'args' added in redis 4.1.2
def check_health(self) -> None: ...
def send_packed_command(self, command, check_health: bool = ...): ...
def send_command(self, *args): ...