Updated typeshed stubs to the latest version.

This commit is contained in:
Eric Traut 2021-12-21 08:08:11 -07:00
parent 12eb0bf32d
commit 7475c7b3a8
461 changed files with 20768 additions and 849 deletions

View File

@ -1 +1 @@
da895e39448498971d437def4c4e464c419f2043
387ef818837a44696e1efe5e935324869d1cf437

View File

@ -139,6 +139,7 @@ imghdr: 2.7-
imp: 2.7-
importlib: 2.7-
importlib.metadata: 3.8-
importlib.metadata._meta: 3.10-
importlib.resources: 3.7-
inspect: 2.7-
io: 2.7-

View File

@ -1,21 +1,31 @@
import sys
from _typeshed import SupportsLessThan
from _typeshed import SupportsRichComparison
from typing import Callable, MutableSequence, Sequence, TypeVar
_T = TypeVar("_T")
if sys.version_info >= (3, 10):
def bisect_left(
a: Sequence[_T], x: _T, lo: int = ..., hi: int | None = ..., *, key: Callable[[_T], SupportsLessThan] | None = ...
a: Sequence[_T], x: _T, lo: int = ..., hi: int | None = ..., *, key: Callable[[_T], SupportsRichComparison] | None = ...
) -> int: ...
def bisect_right(
a: Sequence[_T], x: _T, lo: int = ..., hi: int | None = ..., *, key: Callable[[_T], SupportsLessThan] | None = ...
a: Sequence[_T], x: _T, lo: int = ..., hi: int | None = ..., *, key: Callable[[_T], SupportsRichComparison] | None = ...
) -> int: ...
def insort_left(
a: MutableSequence[_T], x: _T, lo: int = ..., hi: int | None = ..., *, key: Callable[[_T], SupportsLessThan] | None = ...
a: MutableSequence[_T],
x: _T,
lo: int = ...,
hi: int | None = ...,
*,
key: Callable[[_T], SupportsRichComparison] | None = ...,
) -> None: ...
def insort_right(
a: MutableSequence[_T], x: _T, lo: int = ..., hi: int | None = ..., *, key: Callable[[_T], SupportsLessThan] | None = ...
a: MutableSequence[_T],
x: _T,
lo: int = ...,
hi: int | None = ...,
*,
key: Callable[[_T], SupportsRichComparison] | None = ...,
) -> None: ...
else:

View File

@ -24,10 +24,22 @@ def escape_decode(__data: str | bytes, __errors: str | None = ...) -> tuple[str,
def escape_encode(__data: bytes, __errors: str | None = ...) -> tuple[bytes, int]: ...
def latin_1_decode(__data: bytes, __errors: str | None = ...) -> tuple[str, int]: ...
def latin_1_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
if sys.version_info >= (3, 9):
def raw_unicode_escape_decode(__data: str | bytes, __errors: str | None = ..., __final: bool = ...) -> tuple[str, int]: ...
else:
def raw_unicode_escape_decode(__data: str | bytes, __errors: str | None = ...) -> tuple[str, int]: ...
def raw_unicode_escape_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
def readbuffer_encode(__data: str | bytes, __errors: str | None = ...) -> tuple[bytes, int]: ...
if sys.version_info >= (3, 9):
def unicode_escape_decode(__data: str | bytes, __errors: str | None = ..., __final: bool = ...) -> tuple[str, int]: ...
else:
def unicode_escape_decode(__data: str | bytes, __errors: str | None = ...) -> tuple[str, int]: ...
def unicode_escape_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
if sys.version_info < (3, 8):

View File

@ -1,8 +1,5 @@
from typing import Any, Iterable, Iterator, List, Protocol, Type, Union
# __version__ is deliberately not defined here or in csv.pyi,
# as it appears to have been hardcoded at "1.0" for a very long time!
QUOTE_ALL: int
QUOTE_MINIMAL: int
QUOTE_NONE: int

View File

@ -1,5 +1,6 @@
import sys
from typing import IO, Any, BinaryIO, NamedTuple, Union, overload
from _typeshed import SupportsRead
from typing import IO, Any, NamedTuple, Union, overload
_chtype = Union[str, bytes, int]
@ -293,9 +294,14 @@ def erasechar() -> bytes: ...
def filter() -> None: ...
def flash() -> None: ...
def flushinp() -> None: ...
if sys.version_info >= (3, 9):
def get_escdelay() -> int: ...
def get_tabsize() -> int: ...
def getmouse() -> tuple[int, int, int, int, int]: ...
def getsyx() -> tuple[int, int]: ...
def getwin(__file: BinaryIO) -> _CursesWindow: ...
def getwin(__file: SupportsRead[bytes]) -> _CursesWindow: ...
def halfdelay(__tenths: int) -> None: ...
def has_colors() -> bool: ...
@ -337,6 +343,11 @@ def resetty() -> None: ...
def resize_term(__nlines: int, __ncols: int) -> None: ...
def resizeterm(__nlines: int, __ncols: int) -> None: ...
def savetty() -> None: ...
if sys.version_info >= (3, 9):
def set_escdelay(__ms: int) -> None: ...
def set_tabsize(__size: int) -> None: ...
def setsyx(__y: int, __x: int) -> None: ...
def setupterm(term: str | None = ..., fd: int = ...) -> None: ...
def start_color() -> None: ...
@ -344,7 +355,7 @@ def termattrs() -> int: ...
def termname() -> bytes: ...
def tigetflag(__capname: str) -> int: ...
def tigetnum(__capname: str) -> int: ...
def tigetstr(__capname: str) -> bytes: ...
def tigetstr(__capname: str) -> bytes | None: ...
def tparm(
__str: bytes,
__i1: int = ...,
@ -362,7 +373,7 @@ def unctrl(__ch: _chtype) -> bytes: ...
def unget_wch(__ch: int | str) -> None: ...
def ungetch(__ch: _chtype) -> None: ...
def ungetmouse(__id: int, __x: int, __y: int, __z: int, __bstate: int) -> None: ...
def update_lines_cols() -> int: ...
def update_lines_cols() -> None: ...
def use_default_colors() -> None: ...
def use_env(__flag: bool) -> None: ...

View File

@ -1,4 +1,5 @@
import sys
from _typeshed import SupportsAnyComparison
from typing import (
Any,
AnyStr,
@ -14,7 +15,6 @@ from typing import (
SupportsAbs,
Tuple,
TypeVar,
Union,
overload,
)
from typing_extensions import ParamSpec, SupportsIndex, final
@ -35,27 +35,13 @@ class _SupportsNeg(Protocol[_T_co]):
class _SupportsPos(Protocol[_T_co]):
def __pos__(self) -> _T_co: ...
# Different to _typeshed.SupportsLessThan
class _SupportsLT(Protocol):
def __lt__(self, other: Any) -> Any: ...
class _SupportsGT(Protocol):
def __gt__(self, other: Any) -> Any: ...
class _SupportsLE(Protocol):
def __le__(self, other: Any) -> Any: ...
class _SupportsGE(Protocol):
def __ge__(self, other: Any) -> Any: ...
_SupportsComparison = Union[_SupportsLE, _SupportsGE, _SupportsGT, _SupportsLT]
def lt(__a: _SupportsComparison, __b: _SupportsComparison) -> Any: ...
def le(__a: _SupportsComparison, __b: _SupportsComparison) -> Any: ...
# All four comparison functions must have the same signature, or we get false-positive errors
def lt(__a: SupportsAnyComparison, __b: SupportsAnyComparison) -> Any: ...
def le(__a: SupportsAnyComparison, __b: SupportsAnyComparison) -> Any: ...
def eq(__a: object, __b: object) -> Any: ...
def ne(__a: object, __b: object) -> Any: ...
def ge(__a: _SupportsComparison, __b: _SupportsComparison) -> Any: ...
def gt(__a: _SupportsComparison, __b: _SupportsComparison) -> Any: ...
def ge(__a: SupportsAnyComparison, __b: SupportsAnyComparison) -> Any: ...
def gt(__a: SupportsAnyComparison, __b: SupportsAnyComparison) -> Any: ...
def not_(__a: object) -> bool: ...
def truth(__a: object) -> bool: ...
def is_(__a: object, __b: object) -> bool: ...

View File

@ -527,6 +527,8 @@ class socket:
family: int
type: int
proto: int
@property
def timeout(self) -> float | None: ...
def __init__(self, family: int = ..., type: int = ..., proto: int = ..., fileno: _FD | None = ...) -> None: ...
def bind(self, __address: _Address | bytes) -> None: ...
def close(self) -> None: ...

View File

@ -1,4 +1,5 @@
import sys
from _typeshed import structseq
from threading import Thread
from types import TracebackType
from typing import Any, Callable, NoReturn, Optional, Tuple, Type
@ -32,7 +33,9 @@ TIMEOUT_MAX: float
if sys.version_info >= (3, 8):
def get_native_id() -> int: ... # only available on some platforms
@final
class _ExceptHookArgs(Tuple[Type[BaseException], Optional[BaseException], Optional[TracebackType], Optional[Thread]]):
class _ExceptHookArgs(
structseq[Any], Tuple[Type[BaseException], Optional[BaseException], Optional[TracebackType], Optional[Thread]]
):
@property
def exc_type(self) -> Type[BaseException]: ...
@property

View File

@ -7,7 +7,7 @@ import ctypes
import mmap
import sys
from os import PathLike
from typing import AbstractSet, Any, Awaitable, Container, Iterable, Protocol, TypeVar, Union
from typing import AbstractSet, Any, Awaitable, ClassVar, Container, Generic, Iterable, Protocol, Type, TypeVar, Union
from typing_extensions import Literal, final
_KT = TypeVar("_KT")
@ -35,15 +35,25 @@ class SupportsNext(Protocol[_T_co]):
class SupportsAnext(Protocol[_T_co]):
def __anext__(self) -> Awaitable[_T_co]: ...
class SupportsLessThan(Protocol):
def __lt__(self, __other: Any) -> bool: ...
# Comparison protocols
SupportsLessThanT = TypeVar("SupportsLessThanT", bound=SupportsLessThan) # noqa: Y001
class SupportsDunderLT(Protocol):
def __lt__(self, __other: Any) -> Any: ...
class SupportsGreaterThan(Protocol):
def __gt__(self, __other: Any) -> bool: ...
class SupportsDunderGT(Protocol):
def __gt__(self, __other: Any) -> Any: ...
SupportsGreaterThanT = TypeVar("SupportsGreaterThanT", bound=SupportsGreaterThan) # noqa: Y001
class SupportsDunderLE(Protocol):
def __le__(self, __other: Any) -> Any: ...
class SupportsDunderGE(Protocol):
def __ge__(self, __other: Any) -> Any: ...
class SupportsAllComparisons(SupportsDunderLT, SupportsDunderGT, SupportsDunderLE, SupportsDunderGE, Protocol): ...
SupportsRichComparison = Union[SupportsDunderLT, SupportsDunderGT]
SupportsRichComparisonT = TypeVar("SupportsRichComparisonT", bound=SupportsRichComparison) # noqa: Y001
SupportsAnyComparison = Union[SupportsDunderLE, SupportsDunderGE, SupportsDunderGT, SupportsDunderLT]
class SupportsDivMod(Protocol[_T_contra, _T_co]):
def __divmod__(self, __other: _T_contra) -> _T_co: ...
@ -189,3 +199,20 @@ else:
@final
class NoneType:
def __bool__(self) -> Literal[False]: ...
# This is an internal CPython type that is like, but subtly different from, a NamedTuple
# Subclasses of this type are found in multiple modules.
# In typeshed, `structseq` is only ever used as a mixin in combination with a fixed-length `Tuple`
# See discussion at #6546 & #6560
# `structseq` classes are unsubclassable, so are all decorated with `@final`.
class structseq(Generic[_T_co]):
n_fields: ClassVar[int]
n_unnamed_fields: ClassVar[int]
n_sequence_fields: ClassVar[int]
# The first parameter will generally only take an iterable of a specific length.
# E.g. `os.uname_result` takes any iterable of length exactly 5.
#
# The second parameter will accept a dict of any kind without raising an exception,
# but only has any meaning if you supply it a dict where the keys are strings.
# https://github.com/python/typeshed/pull/6560#discussion_r767149830
def __new__(cls: Type[_T], sequence: Iterable[_T_co], dict: dict[str, Any] = ...) -> _T: ...

View File

@ -1,7 +1,6 @@
# See the README.md file in this directory for more information.
from typing import Any
from typing_extensions import Protocol
from typing import Any, Protocol
# As defined https://docs.python.org/3/library/xml.dom.html#domimplementation-objects
class DOMImplementation(Protocol):

View File

@ -165,6 +165,57 @@ if sys.version_info >= (3, 8):
feature_version: None | int | _typing.Tuple[int, int] = ...,
) -> Module: ...
@overload
def parse(
source: str | bytes,
filename: str | bytes,
mode: Literal["eval"],
*,
type_comments: bool = ...,
feature_version: None | int | _typing.Tuple[int, int] = ...,
) -> Expression: ...
@overload
def parse(
source: str | bytes,
filename: str | bytes,
mode: Literal["func_type"],
*,
type_comments: bool = ...,
feature_version: None | int | _typing.Tuple[int, int] = ...,
) -> FunctionType: ...
@overload
def parse(
source: str | bytes,
filename: str | bytes,
mode: Literal["single"],
*,
type_comments: bool = ...,
feature_version: None | int | _typing.Tuple[int, int] = ...,
) -> Interactive: ...
@overload
def parse(
source: str | bytes,
*,
mode: Literal["eval"],
type_comments: bool = ...,
feature_version: None | int | _typing.Tuple[int, int] = ...,
) -> Expression: ...
@overload
def parse(
source: str | bytes,
*,
mode: Literal["func_type"],
type_comments: bool = ...,
feature_version: None | int | _typing.Tuple[int, int] = ...,
) -> FunctionType: ...
@overload
def parse(
source: str | bytes,
*,
mode: Literal["single"],
type_comments: bool = ...,
feature_version: None | int | _typing.Tuple[int, int] = ...,
) -> Interactive: ...
@overload
def parse(
source: str | bytes,
filename: str | bytes = ...,
@ -178,6 +229,14 @@ else:
@overload
def parse(source: str | bytes, filename: str | bytes = ..., mode: Literal["exec"] = ...) -> Module: ...
@overload
def parse(source: str | bytes, filename: str | bytes, mode: Literal["eval"]) -> Expression: ...
@overload
def parse(source: str | bytes, filename: str | bytes, mode: Literal["single"]) -> Interactive: ...
@overload
def parse(source: str | bytes, *, mode: Literal["eval"]) -> Expression: ...
@overload
def parse(source: str | bytes, *, mode: Literal["single"]) -> Interactive: ...
@overload
def parse(source: str | bytes, filename: str | bytes = ..., mode: str = ...) -> AST: ...
if sys.version_info >= (3, 9):

View File

@ -73,39 +73,46 @@ from .transports import (
if sys.version_info < (3, 11):
from .coroutines import coroutine as coroutine
if sys.version_info >= (3, 7):
from .events import get_running_loop as get_running_loop
if sys.version_info >= (3, 9):
from .threads import to_thread as to_thread
if sys.version_info >= (3, 8):
from .exceptions import (
CancelledError as CancelledError,
IncompleteReadError as IncompleteReadError,
InvalidStateError as InvalidStateError,
LimitOverrunError as LimitOverrunError,
SendfileNotAvailableError as SendfileNotAvailableError,
TimeoutError as TimeoutError,
)
else:
if sys.version_info >= (3, 7):
from .events import SendfileNotAvailableError as SendfileNotAvailableError
from .futures import CancelledError as CancelledError, InvalidStateError as InvalidStateError, TimeoutError as TimeoutError
from .streams import IncompleteReadError as IncompleteReadError, LimitOverrunError as LimitOverrunError
if sys.version_info >= (3, 8):
from .exceptions import SendfileNotAvailableError as SendfileNotAvailableError
elif sys.version_info >= (3, 7):
from .events import SendfileNotAvailableError as SendfileNotAvailableError
if sys.version_info >= (3, 7):
from .events import get_running_loop as get_running_loop
from .protocols import BufferedProtocol as BufferedProtocol
if sys.version_info >= (3, 7):
from .runners import run as run
if sys.version_info >= (3, 7):
from .tasks import all_tasks as all_tasks, create_task as create_task, current_task as current_task
if sys.version_info >= (3, 9):
from .threads import to_thread as to_thread
from .tasks import (
_enter_task as _enter_task,
_leave_task as _leave_task,
_register_task as _register_task,
_unregister_task as _unregister_task,
all_tasks as all_tasks,
create_task as create_task,
current_task as current_task,
)
DefaultEventLoopPolicy: Type[AbstractEventLoopPolicy]
if sys.platform == "win32":
from .windows_events import *
if sys.platform != "win32":
else:
from .streams import open_unix_connection as open_unix_connection, start_unix_server as start_unix_server
from .unix_events import (
AbstractChildWatcher as AbstractChildWatcher,

View File

@ -1,7 +1,7 @@
import sys
from socket import socket
from typing import Any, Mapping, Type
from typing_extensions import Literal, Protocol
from typing import Any, Mapping, Protocol, Type
from typing_extensions import Literal
from . import base_events, constants, events, futures, streams, transports

View File

@ -13,14 +13,12 @@ from _typeshed import (
StrOrBytesPath,
SupportsAnext,
SupportsDivMod,
SupportsGreaterThan,
SupportsGreaterThanT,
SupportsKeysAndGetItem,
SupportsLenAndGetItem,
SupportsLessThan,
SupportsLessThanT,
SupportsNext,
SupportsRDivMod,
SupportsRichComparison,
SupportsRichComparisonT,
SupportsTrunc,
SupportsWrite,
)
@ -30,8 +28,6 @@ from typing import (
IO,
AbstractSet,
Any,
AsyncIterable,
AsyncIterator,
BinaryIO,
ByteString,
Callable,
@ -78,6 +74,14 @@ _T5 = TypeVar("_T5")
_TT = TypeVar("_TT", bound="type")
_TBE = TypeVar("_TBE", bound="BaseException")
_R = TypeVar("_R") # Return-type TypeVar
_SupportsNextT = TypeVar("_SupportsNextT", bound=SupportsNext[Any], covariant=True)
_SupportsAnextT = TypeVar("_SupportsAnextT", bound=SupportsAnext[Any], covariant=True)
class _SupportsIter(Protocol[_T_co]):
def __iter__(self) -> _T_co: ...
class _SupportsAiter(Protocol[_T_co]):
def __aiter__(self) -> _T_co: ...
class object:
__doc__: str | None
@ -772,7 +776,6 @@ class list(MutableSequence[_T], Generic[_T]):
def __init__(self) -> None: ...
@overload
def __init__(self, __iterable: Iterable[_T]) -> None: ...
def clear(self) -> None: ...
def copy(self) -> list[_T]: ...
def append(self, __object: _T) -> None: ...
def extend(self, __iterable: Iterable[_T]) -> None: ...
@ -782,12 +785,11 @@ class list(MutableSequence[_T], Generic[_T]):
def count(self, __value: _T) -> int: ...
def insert(self, __index: SupportsIndex, __object: _T) -> None: ...
def remove(self, __value: _T) -> None: ...
def reverse(self) -> None: ...
# Signature of `list.sort` should be kept inline with `collections.UserList.sort()`
@overload
def sort(self: list[SupportsLessThanT], *, key: None = ..., reverse: bool = ...) -> None: ...
def sort(self: list[SupportsRichComparisonT], *, key: None = ..., reverse: bool = ...) -> None: ...
@overload
def sort(self, *, key: Callable[[_T], SupportsLessThan], reverse: bool = ...) -> None: ...
def sort(self, *, key: Callable[[_T], SupportsRichComparison], reverse: bool = ...) -> None: ...
def __len__(self) -> int: ...
def __iter__(self) -> Iterator[_T]: ...
def __str__(self) -> str: ...
@ -816,6 +818,7 @@ class list(MutableSequence[_T], Generic[_T]):
def __class_getitem__(cls, __item: Any) -> GenericAlias: ...
class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
# __init__ should be kept roughly in line with `collections.UserDict.__init__`, which has similar semantics
@overload
def __init__(self: dict[_KT, _VT]) -> None: ...
@overload
@ -829,20 +832,11 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
@overload
def __init__(self: dict[str, str], __iterable: Iterable[list[str]]) -> None: ...
def __new__(cls: Type[_T1], *args: Any, **kwargs: Any) -> _T1: ...
def clear(self) -> None: ...
def copy(self) -> dict[_KT, _VT]: ...
def popitem(self) -> tuple[_KT, _VT]: ...
def setdefault(self, __key: _KT, __default: _VT = ...) -> _VT: ...
@overload
def update(self, __m: Mapping[_KT, _VT], **kwargs: _VT) -> None: ...
@overload
def update(self, __m: Iterable[tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
@overload
def update(self, **kwargs: _VT) -> None: ...
def keys(self) -> dict_keys[_KT, _VT]: ...
def values(self) -> dict_values[_KT, _VT]: ...
def items(self) -> dict_items[_KT, _VT]: ...
# Signature of `dict.fromkeys` should be kept identical to `fromkeys` methods in `collections.OrderedDict`/`collections.ChainMap`
# Signature of `dict.fromkeys` should be kept identical to `fromkeys` methods of `OrderedDict`/`ChainMap`/`UserDict` in `collections`
# TODO: the true signature of `dict.fromkeys` is not expressable in the current type system.
# See #3800 & https://github.com/python/typing/issues/548#issuecomment-683336963.
@classmethod
@ -869,7 +863,6 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
class set(MutableSet[_T], Generic[_T]):
def __init__(self, __iterable: Iterable[_T] = ...) -> None: ...
def add(self, __element: _T) -> None: ...
def clear(self) -> None: ...
def copy(self) -> set[_T]: ...
def difference(self, *s: Iterable[Any]) -> set[_T]: ...
def difference_update(self, *s: Iterable[Any]) -> None: ...
@ -879,7 +872,6 @@ class set(MutableSet[_T], Generic[_T]):
def isdisjoint(self, __s: Iterable[Any]) -> bool: ...
def issubset(self, __s: Iterable[Any]) -> bool: ...
def issuperset(self, __s: Iterable[Any]) -> bool: ...
def pop(self) -> _T: ...
def remove(self, __element: _T) -> None: ...
def symmetric_difference(self, __s: Iterable[_T]) -> set[_T]: ...
def symmetric_difference_update(self, __s: Iterable[_T]) -> None: ...
@ -1004,7 +996,7 @@ class _PathLike(Protocol[_AnyStr_co]):
def __fspath__(self) -> _AnyStr_co: ...
if sys.version_info >= (3, 10):
def aiter(__async_iterable: AsyncIterable[_T]) -> AsyncIterator[_T]: ...
def aiter(__async_iterable: _SupportsAiter[_SupportsAnextT]) -> _SupportsAnextT: ...
@overload
async def anext(__i: SupportsAnext[_T]) -> _T: ...
@overload
@ -1082,12 +1074,12 @@ def getattr(__o: object, __name: str, __default: _T) -> Any | _T: ...
def globals() -> dict[str, Any]: ...
def hasattr(__obj: object, __name: str) -> bool: ...
def hash(__obj: object) -> int: ...
def help(*args: Any, **kwds: Any) -> None: ...
def help(request: object = ...) -> None: ...
def hex(__number: int | SupportsIndex) -> str: ...
def id(__obj: object) -> int: ...
def input(__prompt: object = ...) -> str: ...
@overload
def iter(__iterable: Iterable[_T]) -> Iterator[_T]: ...
def iter(__iterable: _SupportsIter[_SupportsNextT]) -> _SupportsNextT: ...
@overload
def iter(__function: Callable[[], _T | None], __sentinel: None) -> Iterator[_T]: ...
@overload
@ -1155,32 +1147,32 @@ class map(Iterator[_S], Generic[_S]):
@overload
def max(
__arg1: SupportsGreaterThanT, __arg2: SupportsGreaterThanT, *_args: SupportsGreaterThanT, key: None = ...
) -> SupportsGreaterThanT: ...
__arg1: SupportsRichComparisonT, __arg2: SupportsRichComparisonT, *_args: SupportsRichComparisonT, key: None = ...
) -> SupportsRichComparisonT: ...
@overload
def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], SupportsGreaterThan]) -> _T: ...
def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], SupportsRichComparison]) -> _T: ...
@overload
def max(__iterable: Iterable[SupportsGreaterThanT], *, key: None = ...) -> SupportsGreaterThanT: ...
def max(__iterable: Iterable[SupportsRichComparisonT], *, key: None = ...) -> SupportsRichComparisonT: ...
@overload
def max(__iterable: Iterable[_T], *, key: Callable[[_T], SupportsGreaterThan]) -> _T: ...
def max(__iterable: Iterable[_T], *, key: Callable[[_T], SupportsRichComparison]) -> _T: ...
@overload
def max(__iterable: Iterable[SupportsGreaterThanT], *, key: None = ..., default: _T) -> SupportsGreaterThanT | _T: ...
def max(__iterable: Iterable[SupportsRichComparisonT], *, key: None = ..., default: _T) -> SupportsRichComparisonT | _T: ...
@overload
def max(__iterable: Iterable[_T1], *, key: Callable[[_T1], SupportsGreaterThan], default: _T2) -> _T1 | _T2: ...
def max(__iterable: Iterable[_T1], *, key: Callable[[_T1], SupportsRichComparison], default: _T2) -> _T1 | _T2: ...
@overload
def min(
__arg1: SupportsLessThanT, __arg2: SupportsLessThanT, *_args: SupportsLessThanT, key: None = ...
) -> SupportsLessThanT: ...
__arg1: SupportsRichComparisonT, __arg2: SupportsRichComparisonT, *_args: SupportsRichComparisonT, key: None = ...
) -> SupportsRichComparisonT: ...
@overload
def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], SupportsLessThan]) -> _T: ...
def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], SupportsRichComparison]) -> _T: ...
@overload
def min(__iterable: Iterable[SupportsLessThanT], *, key: None = ...) -> SupportsLessThanT: ...
def min(__iterable: Iterable[SupportsRichComparisonT], *, key: None = ...) -> SupportsRichComparisonT: ...
@overload
def min(__iterable: Iterable[_T], *, key: Callable[[_T], SupportsLessThan]) -> _T: ...
def min(__iterable: Iterable[_T], *, key: Callable[[_T], SupportsRichComparison]) -> _T: ...
@overload
def min(__iterable: Iterable[SupportsLessThanT], *, key: None = ..., default: _T) -> SupportsLessThanT | _T: ...
def min(__iterable: Iterable[SupportsRichComparisonT], *, key: None = ..., default: _T) -> SupportsRichComparisonT | _T: ...
@overload
def min(__iterable: Iterable[_T1], *, key: Callable[[_T1], SupportsLessThan], default: _T2) -> _T1 | _T2: ...
def min(__iterable: Iterable[_T1], *, key: Callable[[_T1], SupportsRichComparison], default: _T2) -> _T1 | _T2: ...
@overload
def next(__i: SupportsNext[_T]) -> _T: ...
@overload
@ -1391,19 +1383,21 @@ def round(number: SupportsRound[_T], ndigits: SupportsIndex) -> _T: ...
# for why arg 3 of `setattr` should be annotated with `Any` and not `object`
def setattr(__obj: object, __name: str, __value: Any) -> None: ...
@overload
def sorted(__iterable: Iterable[SupportsLessThanT], *, key: None = ..., reverse: bool = ...) -> list[SupportsLessThanT]: ...
def sorted(
__iterable: Iterable[SupportsRichComparisonT], *, key: None = ..., reverse: bool = ...
) -> list[SupportsRichComparisonT]: ...
@overload
def sorted(__iterable: Iterable[_T], *, key: Callable[[_T], SupportsLessThan], reverse: bool = ...) -> list[_T]: ...
def sorted(__iterable: Iterable[_T], *, key: Callable[[_T], SupportsRichComparison], reverse: bool = ...) -> list[_T]: ...
if sys.version_info >= (3, 8):
@overload
def sum(__iterable: Iterable[_T]) -> _T | int: ...
def sum(__iterable: Iterable[_T]) -> _T | Literal[0]: ...
@overload
def sum(__iterable: Iterable[_T], start: _S) -> _T | _S: ...
else:
@overload
def sum(__iterable: Iterable[_T]) -> _T | int: ...
def sum(__iterable: Iterable[_T]) -> _T | Literal[0]: ...
@overload
def sum(__iterable: Iterable[_T], __start: _S) -> _T | _S: ...
@ -1511,6 +1505,8 @@ class BaseException(object):
__context__: BaseException | None
__suppress_context__: bool
__traceback__: TracebackType | None
if sys.version_info >= (3, 11):
__note__: str | None
def __init__(self, *args: object) -> None: ...
def __str__(self) -> str: ...
def __repr__(self) -> str: ...

View File

@ -5,6 +5,11 @@ from abc import abstractmethod
from typing import IO, Any, BinaryIO, Callable, Generator, Iterable, Iterator, Protocol, TextIO, Tuple, Type, TypeVar, overload
from typing_extensions import Literal
BOM32_BE: bytes
BOM32_LE: bytes
BOM64_BE: bytes
BOM64_LE: bytes
# TODO: this only satisfies the most common interface, where
# bytes is the raw form and str is the cooked form.
# In the long run, both should become template parameters maybe?

View File

@ -1,6 +1,6 @@
import sys
from _collections_abc import dict_items, dict_keys, dict_values
from _typeshed import Self, SupportsLessThan, SupportsLessThanT
from _typeshed import Self, SupportsKeysAndGetItem, SupportsRichComparison, SupportsRichComparisonT
from typing import Any, Dict, Generic, NoReturn, Tuple, Type, TypeVar, overload
from typing_extensions import SupportsIndex, final
@ -35,9 +35,19 @@ else:
typename: str, field_names: str | Iterable[str], *, verbose: bool = ..., rename: bool = ..., module: str | None = ...
) -> Type[Tuple[Any, ...]]: ...
class UserDict(MutableMapping[_KT, _VT]):
class UserDict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
data: dict[_KT, _VT]
def __init__(self, __dict: Mapping[_KT, _VT] | None = ..., **kwargs: _VT) -> None: ...
# __init__ should be kept roughly in line with `dict.__init__`, which has the same semantics
@overload
def __init__(self: UserDict[_KT, _VT], __dict: None = ...) -> None: ...
@overload
def __init__(self: UserDict[str, _VT], __dict: None = ..., **kwargs: _VT) -> None: ...
@overload
def __init__(self, __dict: SupportsKeysAndGetItem[_KT, _VT], **kwargs: _VT) -> None: ...
@overload
def __init__(self, __iterable: Iterable[tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
@overload
def __init__(self: UserDict[str, str], __iterable: Iterable[list[str]]) -> None: ...
def __len__(self) -> int: ...
def __getitem__(self, key: _KT) -> _VT: ...
def __setitem__(self, key: _KT, item: _VT) -> None: ...
@ -45,8 +55,15 @@ class UserDict(MutableMapping[_KT, _VT]):
def __iter__(self) -> Iterator[_KT]: ...
def __contains__(self, key: object) -> bool: ...
def copy(self: Self) -> Self: ...
# `UserDict.fromkeys` has the same semantics as `dict.fromkeys`, so should be kept in line with `dict.fromkeys`.
# TODO: Much like `dict.fromkeys`, the true signature of `UserDict.fromkeys` is inexpressable in the current type system.
# See #3800 & https://github.com/python/typing/issues/548#issuecomment-683336963.
@classmethod
def fromkeys(cls: Type[Self], iterable: Iterable[_KT], value: _VT | None = ...) -> Self: ...
@overload
def fromkeys(cls, iterable: Iterable[_T], value: None = ...) -> UserDict[_T, Any | None]: ...
@classmethod
@overload
def fromkeys(cls, iterable: Iterable[_T], value: _S) -> UserDict[_T, _S]: ...
class UserList(MutableSequence[_T]):
data: list[_T]
@ -74,17 +91,15 @@ class UserList(MutableSequence[_T]):
def insert(self, i: int, item: _T) -> None: ...
def pop(self, i: int = ...) -> _T: ...
def remove(self, item: _T) -> None: ...
def clear(self) -> None: ...
def copy(self: _S) -> _S: ...
def count(self, item: _T) -> int: ...
# All arguments are passed to `list.index` at runtime, so the signature should be kept in line with `list.index`.
def index(self, item: _T, __start: SupportsIndex = ..., __stop: SupportsIndex = ...) -> int: ...
def reverse(self) -> None: ...
# All arguments are passed to `list.sort` at runtime, so the signature should be kept in line with `list.sort`.
@overload
def sort(self: UserList[SupportsLessThanT], *, key: None = ..., reverse: bool = ...) -> None: ...
def sort(self: UserList[SupportsRichComparisonT], *, key: None = ..., reverse: bool = ...) -> None: ...
@overload
def sort(self, *, key: Callable[[_T], SupportsLessThan], reverse: bool = ...) -> None: ...
def sort(self, *, key: Callable[[_T], SupportsRichComparison], reverse: bool = ...) -> None: ...
def extend(self, other: Iterable[_T]) -> None: ...
_UserStringT = TypeVar("_UserStringT", bound=UserString)
@ -173,7 +188,6 @@ class deque(MutableSequence[_T], Generic[_T]):
def __init__(self, iterable: Iterable[_T] = ..., maxlen: int | None = ...) -> None: ...
def append(self, __x: _T) -> None: ...
def appendleft(self, __x: _T) -> None: ...
def clear(self) -> None: ...
def copy(self: _S) -> _S: ...
def count(self, __x: _T) -> int: ...
def extend(self, __iterable: Iterable[_T]) -> None: ...
@ -183,29 +197,16 @@ class deque(MutableSequence[_T], Generic[_T]):
def pop(self) -> _T: ... # type: ignore[override]
def popleft(self) -> _T: ...
def remove(self, __value: _T) -> None: ...
def reverse(self) -> None: ...
def rotate(self, __n: int = ...) -> None: ...
def __copy__(self: _S) -> _S: ...
def __len__(self) -> int: ...
def __iter__(self) -> Iterator[_T]: ...
def __str__(self) -> str: ...
# These methods of deque don't really take slices, but we need to
# define them as taking a slice to satisfy MutableSequence.
@overload
def __getitem__(self, __index: SupportsIndex) -> _T: ...
@overload
def __getitem__(self, __s: slice) -> MutableSequence[_T]: ...
@overload
def __setitem__(self, __i: SupportsIndex, __x: _T) -> None: ...
@overload
def __setitem__(self, __s: slice, __o: Iterable[_T]) -> None: ...
@overload
def __delitem__(self, __i: SupportsIndex) -> None: ...
@overload
def __delitem__(self, __s: slice) -> None: ...
# These methods of deque don't take slices, unlike MutableSequence, hence the type: ignores
def __getitem__(self, __index: SupportsIndex) -> _T: ... # type: ignore[override]
def __setitem__(self, __i: SupportsIndex, __x: _T) -> None: ... # type: ignore[override]
def __delitem__(self, __i: SupportsIndex) -> None: ... # type: ignore[override]
def __contains__(self, __o: object) -> bool: ...
def __reduce__(self: Self) -> tuple[Type[Self], tuple[()], None, Iterator[_T]]: ...
def __reversed__(self) -> Iterator[_T]: ...
def __iadd__(self: _S, __iterable: Iterable[_T]) -> _S: ...
def __add__(self: _S, __other: _S) -> _S: ...
def __mul__(self: _S, __other: int) -> _S: ...
@ -217,7 +218,7 @@ class Counter(Dict[_T, int], Generic[_T]):
@overload
def __init__(self, __iterable: None = ..., **kwargs: int) -> None: ...
@overload
def __init__(self, __mapping: Mapping[_T, int]) -> None: ...
def __init__(self, __mapping: SupportsKeysAndGetItem[_T, int]) -> None: ...
@overload
def __init__(self, __iterable: Iterable[_T]) -> None: ...
def copy(self: Self) -> Self: ...
@ -237,7 +238,7 @@ class Counter(Dict[_T, int], Generic[_T]):
# Dict.update. Not sure if we should use '# type: ignore' instead
# and omit the type from the union.
@overload
def update(self, __m: Mapping[_T, int], **kwargs: int) -> None: ...
def update(self, __m: SupportsKeysAndGetItem[_T, int], **kwargs: int) -> None: ...
@overload
def update(self, __m: Iterable[_T] | Iterable[tuple[_T, int]], **kwargs: int) -> None: ...
@overload
@ -294,9 +295,11 @@ class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]):
@overload
def __init__(self, __default_factory: Callable[[], _VT] | None, **kwargs: _VT) -> None: ...
@overload
def __init__(self, __default_factory: Callable[[], _VT] | None, __map: Mapping[_KT, _VT]) -> None: ...
def __init__(self, __default_factory: Callable[[], _VT] | None, __map: SupportsKeysAndGetItem[_KT, _VT]) -> None: ...
@overload
def __init__(self, __default_factory: Callable[[], _VT] | None, __map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ...
def __init__(
self, __default_factory: Callable[[], _VT] | None, __map: SupportsKeysAndGetItem[_KT, _VT], **kwargs: _VT
) -> None: ...
@overload
def __init__(self, __default_factory: Callable[[], _VT] | None, __iterable: Iterable[tuple[_KT, _VT]]) -> None: ...
@overload

View File

@ -11,11 +11,12 @@ from typing import (
Generic,
Iterator,
Optional,
Protocol,
Type,
TypeVar,
overload,
)
from typing_extensions import ParamSpec, Protocol
from typing_extensions import ParamSpec
AbstractContextManager = ContextManager
if sys.version_info >= (3, 7):
@ -32,14 +33,25 @@ _P = ParamSpec("_P")
_ExitFunc = Callable[[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]], bool]
_CM_EF = TypeVar("_CM_EF", AbstractContextManager[Any], _ExitFunc)
class _GeneratorContextManager(AbstractContextManager[_T_co]):
class ContextDecorator:
def __call__(self, func: _F) -> _F: ...
class _GeneratorContextManager(AbstractContextManager[_T_co], ContextDecorator): ...
# type ignore to deal with incomplete ParamSpec support in mypy
def contextmanager(func: Callable[_P, Iterator[_T]]) -> Callable[_P, _GeneratorContextManager[_T]]: ... # type: ignore[misc]
if sys.version_info >= (3, 10):
_AF = TypeVar("_AF", bound=Callable[..., Awaitable[Any]])
class AsyncContextDecorator:
def __call__(self, func: _AF) -> _AF: ...
class _AsyncGeneratorContextManager(AbstractAsyncContextManager[_T_co], AsyncContextDecorator): ...
elif sys.version_info >= (3, 7):
class _AsyncGeneratorContextManager(AbstractAsyncContextManager[_T_co]): ...
if sys.version_info >= (3, 7):
def asynccontextmanager(func: Callable[_P, AsyncIterator[_T]]) -> Callable[_P, AbstractAsyncContextManager[_T]]: ... # type: ignore[misc]
def asynccontextmanager(func: Callable[_P, AsyncIterator[_T]]) -> Callable[_P, _AsyncGeneratorContextManager[_T]]: ... # type: ignore[misc]
class _SupportsClose(Protocol):
def close(self) -> object: ...
@ -55,9 +67,6 @@ if sys.version_info >= (3, 10):
_SupportsAcloseT = TypeVar("_SupportsAcloseT", bound=_SupportsAclose)
class aclosing(AbstractAsyncContextManager[_SupportsAcloseT]):
def __init__(self, thing: _SupportsAcloseT) -> None: ...
_AF = TypeVar("_AF", bound=Callable[..., Awaitable[Any]])
class AsyncContextDecorator:
def __call__(self, func: _AF) -> _AF: ...
class suppress(AbstractContextManager[None]):
def __init__(self, *exceptions: Type[BaseException]) -> None: ...
@ -71,9 +80,6 @@ class redirect_stdout(AbstractContextManager[_T_io]):
class redirect_stderr(AbstractContextManager[_T_io]):
def __init__(self, new_target: _T_io) -> None: ...
class ContextDecorator:
def __call__(self, func: _F) -> _F: ...
class ExitStack(AbstractContextManager[ExitStack]):
def __init__(self) -> None: ...
def enter_context(self, cm: AbstractContextManager[_T]) -> _T: ...

View File

@ -25,9 +25,6 @@ if sys.version_info >= (3, 8):
else:
from collections import OrderedDict as _DictReadMapping
# __version__ is deliberately not defined here or in _csv.pyi,
# as it appears to have been hardcoded at "1.0" for a very long time!
_T = TypeVar("_T")
class excel(Dialect):

View File

@ -158,7 +158,7 @@ def create_unicode_buffer(init: int | str, size: int | None = ...) -> Array[c_wc
if sys.platform == "win32":
def DllCanUnloadNow() -> int: ...
def DllGetClassObject(rclsid: Any, riid: Any, ppv: Any) -> int: ... # TODO not documented
def FormatError(code: int) -> str: ...
def FormatError(code: int = ...) -> str: ...
def GetLastError() -> int: ...
def get_errno() -> int: ...

View File

@ -1,7 +1,6 @@
import sys
import types
from typing import Any, Callable, Generic, Iterable, Mapping, Tuple, Type, TypeVar, overload
from typing_extensions import Protocol
from typing import Any, Callable, Generic, Iterable, Mapping, Protocol, Tuple, Type, TypeVar, overload
if sys.version_info >= (3, 9):
from types import GenericAlias
@ -201,6 +200,7 @@ if sys.version_info >= (3, 10):
unsafe_hash: bool = ...,
frozen: bool = ...,
match_args: bool = ...,
kw_only: bool = ...,
slots: bool = ...,
) -> type: ...

View File

@ -1,6 +1,6 @@
from _typeshed import Self
from types import TracebackType
from typing import Iterator, MutableMapping, Tuple, Type, Union
from typing import Iterator, MutableMapping, Type, Union
from typing_extensions import Literal
_KeyType = Union[str, bytes]
@ -87,7 +87,7 @@ class _Database(MutableMapping[_KeyType, bytes]):
class _error(Exception): ...
error = Tuple[Type[_error], Type[OSError]]
error: tuple[Type[_error], Type[OSError]]
def whichdb(filename: str) -> str: ...
def open(file: str, flag: _TFlags = ..., mode: int = ...) -> _Database: ...

View File

@ -20,8 +20,8 @@ from typing import IO, Any, Callable, Iterator, NamedTuple, Union
# Strictly this should not have to include Callable, but mypy doesn't use FunctionType
# for functions (python/mypy#3171)
_have_code = Union[types.MethodType, types.FunctionType, types.CodeType, type, Callable[..., Any]]
_have_code_or_string = Union[_have_code, str, bytes]
_HaveCodeType = Union[types.MethodType, types.FunctionType, types.CodeType, type, Callable[..., Any]]
_HaveCodeOrStringType = Union[_HaveCodeType, str, bytes]
class Instruction(NamedTuple):
opname: str
@ -36,7 +36,7 @@ class Instruction(NamedTuple):
class Bytecode:
codeobj: types.CodeType
first_line: int
def __init__(self, x: _have_code_or_string, *, first_line: int | None = ..., current_offset: int | None = ...) -> None: ...
def __init__(self, x: _HaveCodeOrStringType, *, first_line: int | None = ..., current_offset: int | None = ...) -> None: ...
def __iter__(self) -> Iterator[Instruction]: ...
def __repr__(self) -> str: ...
def info(self) -> str: ...
@ -46,19 +46,19 @@ class Bytecode:
COMPILER_FLAG_NAMES: dict[int, str]
def findlabels(code: _have_code) -> list[int]: ...
def findlinestarts(code: _have_code) -> Iterator[tuple[int, int]]: ...
def findlabels(code: _HaveCodeType) -> list[int]: ...
def findlinestarts(code: _HaveCodeType) -> Iterator[tuple[int, int]]: ...
def pretty_flags(flags: int) -> str: ...
def code_info(x: _have_code_or_string) -> str: ...
def code_info(x: _HaveCodeOrStringType) -> str: ...
if sys.version_info >= (3, 7):
def dis(x: _have_code_or_string | None = ..., *, file: IO[str] | None = ..., depth: int | None = ...) -> None: ...
def dis(x: _HaveCodeOrStringType | None = ..., *, file: IO[str] | None = ..., depth: int | None = ...) -> None: ...
else:
def dis(x: _have_code_or_string | None = ..., *, file: IO[str] | None = ...) -> None: ...
def dis(x: _HaveCodeOrStringType | None = ..., *, file: IO[str] | None = ...) -> None: ...
def distb(tb: types.TracebackType | None = ..., *, file: IO[str] | None = ...) -> None: ...
def disassemble(co: _have_code, lasti: int = ..., *, file: IO[str] | None = ...) -> None: ...
def disco(co: _have_code, lasti: int = ..., *, file: IO[str] | None = ...) -> None: ...
def show_code(co: _have_code, *, file: IO[str] | None = ...) -> None: ...
def get_instructions(x: _have_code, *, first_line: int | None = ...) -> Iterator[Instruction]: ...
def disassemble(co: _HaveCodeType, lasti: int = ..., *, file: IO[str] | None = ...) -> None: ...
def disco(co: _HaveCodeType, lasti: int = ..., *, file: IO[str] | None = ...) -> None: ...
def show_code(co: _HaveCodeType, *, file: IO[str] | None = ...) -> None: ...
def get_instructions(x: _HaveCodeType, *, first_line: int | None = ...) -> Iterator[Instruction]: ...

View File

@ -1,5 +1,6 @@
import sys
import types
from collections.abc import Iterable, Mapping
from datetime import datetime as _datetime
from email._header_value_parser import (
AddressList,
@ -12,28 +13,33 @@ from email._header_value_parser import (
)
from email.errors import MessageDefect
from email.policy import Policy
from typing import Any, Iterable, Tuple, Type
from typing import Any, ClassVar, Tuple, Type
from typing_extensions import Literal
class BaseHeader(str):
# max_count is actually more of an abstract ClassVar (not defined on the base class, but expected to be defined in subclasses)
max_count: ClassVar[Literal[1] | None]
@property
def name(self) -> str: ...
@property
def defects(self) -> Tuple[MessageDefect, ...]: ...
@property
def max_count(self) -> int | None: ...
def __new__(cls, name: str, value: Any) -> BaseHeader: ...
def init(self, name: str, *, parse_tree: TokenList, defects: Iterable[MessageDefect]) -> None: ...
def fold(self, *, policy: Policy) -> str: ...
class UnstructuredHeader:
max_count: ClassVar[Literal[1] | None]
@staticmethod
def value_parser(value: str) -> UnstructuredTokenList: ...
@classmethod
def parse(cls, value: str, kwds: dict[str, Any]) -> None: ...
class UniqueUnstructuredHeader(UnstructuredHeader): ...
class UniqueUnstructuredHeader(UnstructuredHeader):
max_count: ClassVar[Literal[1]]
class DateHeader:
max_count: ClassVar[Literal[1] | None]
def init(self, name: str, *, parse_tree: TokenList, defects: Iterable[MessageDefect], datetime: _datetime) -> None: ...
@property
def datetime(self) -> _datetime: ...
@staticmethod
@ -41,9 +47,12 @@ class DateHeader:
@classmethod
def parse(cls, value: str | _datetime, kwds: dict[str, Any]) -> None: ...
class UniqueDateHeader(DateHeader): ...
class UniqueDateHeader(DateHeader):
max_count: ClassVar[Literal[1]]
class AddressHeader:
max_count: ClassVar[Literal[1] | None]
def init(self, name: str, *, parse_tree: TokenList, defects: Iterable[MessageDefect], groups: Iterable[Group]) -> None: ...
@property
def groups(self) -> Tuple[Group, ...]: ...
@property
@ -53,15 +62,28 @@ class AddressHeader:
@classmethod
def parse(cls, value: str, kwds: dict[str, Any]) -> None: ...
class UniqueAddressHeader(AddressHeader): ...
class UniqueAddressHeader(AddressHeader):
max_count: ClassVar[Literal[1]]
class SingleAddressHeader(AddressHeader):
@property
def address(self) -> Address: ...
class UniqueSingleAddressHeader(SingleAddressHeader): ...
class UniqueSingleAddressHeader(SingleAddressHeader):
max_count: ClassVar[Literal[1]]
class MIMEVersionHeader:
max_count: ClassVar[Literal[1]]
def init(
self,
name: str,
*,
parse_tree: TokenList,
defects: Iterable[MessageDefect],
version: str | None,
major: int | None,
minor: int | None,
) -> None: ...
@property
def version(self) -> str | None: ...
@property
@ -74,6 +96,8 @@ class MIMEVersionHeader:
def parse(cls, value: str, kwds: dict[str, Any]) -> None: ...
class ParameterizedMIMEHeader:
max_count: ClassVar[Literal[1]]
def init(self, name: str, *, parse_tree: TokenList, defects: Iterable[MessageDefect], params: Mapping[str, Any]) -> None: ...
@property
def params(self) -> types.MappingProxyType[str, Any]: ...
@classmethod
@ -90,12 +114,15 @@ class ContentTypeHeader(ParameterizedMIMEHeader):
def value_parser(value: str) -> ContentType: ...
class ContentDispositionHeader(ParameterizedMIMEHeader):
# init is redefined but has the same signature as parent class, so is omitted from the stub
@property
def content_disposition(self) -> str: ...
def content_disposition(self) -> str | None: ...
@staticmethod
def value_parser(value: str) -> ContentDisposition: ...
class ContentTransferEncodingHeader:
max_count: ClassVar[Literal[1]]
def init(self, name: str, *, parse_tree: TokenList, defects: Iterable[MessageDefect]) -> None: ...
@property
def cte(self) -> str: ...
@classmethod
@ -106,6 +133,7 @@ class ContentTransferEncodingHeader:
if sys.version_info >= (3, 8):
from email._header_value_parser import MessageID
class MessageIDHeader:
max_count: ClassVar[Literal[1]]
@classmethod
def parse(cls, value: str, kwds: dict[str, Any]) -> None: ...
@staticmethod

View File

@ -1,17 +1,27 @@
from abc import abstractmethod
from abc import ABCMeta, abstractmethod
from email.contentmanager import ContentManager
from email.errors import MessageDefect
from email.header import Header
from email.message import Message
from typing import Any, Callable
class Policy:
class Policy(metaclass=ABCMeta):
max_line_length: int | None
linesep: str
cte_type: str
raise_on_defect: bool
mange_from: bool
def __init__(self, **kw: Any) -> None: ...
mangle_from_: bool
message_factory: Callable[[Policy], Message] | None
def __init__(
self,
*,
max_line_length: int | None = ...,
linesep: str = ...,
cte_type: str = ...,
raise_on_defect: bool = ...,
mangle_from_: bool = ...,
message_factory: Callable[[Policy], Message] | None = ...,
) -> None: ...
def clone(self, **kw: Any) -> Policy: ...
def handle_defect(self, obj: Message, defect: MessageDefect) -> None: ...
def register_defect(self, obj: Message, defect: MessageDefect) -> None: ...
@ -41,6 +51,20 @@ class EmailPolicy(Policy):
refold_source: str
header_factory: Callable[[str, str], str]
content_manager: ContentManager
def __init__(
self,
*,
max_line_length: int | None = ...,
linesep: str = ...,
cte_type: str = ...,
raise_on_defect: bool = ...,
mangle_from_: bool = ...,
message_factory: Callable[[Policy], Message] | None = ...,
utf8: bool = ...,
refold_source: str = ...,
header_factory: Callable[[str, str], str] = ...,
content_manager: ContentManager = ...,
) -> None: ...
def header_source_parse(self, sourcelines: list[str]) -> tuple[str, str]: ...
def header_store_parse(self, name: str, value: str) -> tuple[str, str]: ...
def header_fetch_parse(self, name: str, value: str) -> str: ...

View File

@ -2,17 +2,49 @@ import sys
import types
from abc import ABCMeta
from builtins import property as _builtins_property
from typing import Any, Iterator, Type, TypeVar
from collections.abc import Iterable, Iterator, Mapping
from typing import Any, Dict, Tuple, Type, TypeVar, Union, overload
_T = TypeVar("_T")
_S = TypeVar("_S", bound=Type[Enum])
# The following all work:
# >>> from enum import Enum
# >>> from string import ascii_lowercase
# >>> Enum('Foo', names='RED YELLOW GREEN')
# <enum 'Foo'>
# >>> Enum('Foo', names=[('RED', 1), ('YELLOW, 2)])
# <enum 'Foo'>
# >>> Enum('Foo', names=((x for x in (ascii_lowercase[i], i)) for i in range(5)))
# <enum 'Foo'>
# >>> Enum('Foo', names={'RED': 1, 'YELLOW': 2})
# <enum 'Foo'>
_EnumNames = Union[str, Iterable[str], Iterable[Iterable[Union[str, Any]]], Mapping[str, Any]]
class _EnumDict(Dict[str, Any]):
def __init__(self) -> None: ...
# Note: EnumMeta actually subclasses type directly, not ABCMeta.
# This is a temporary workaround to allow multiple creation of enums with builtins
# such as str as mixins, which due to the handling of ABCs of builtin types, cause
# spurious inconsistent metaclass structure. See #1595.
# Structurally: Iterable[T], Reversible[T], Container[T] where T is the enum itself
class EnumMeta(ABCMeta):
if sys.version_info >= (3, 11):
def __new__(
metacls: Type[_T],
cls: str,
bases: Tuple[type, ...],
classdict: _EnumDict,
*,
boundary: FlagBoundary | None = ...,
_simple: bool = ...,
**kwds: Any,
) -> _T: ...
elif sys.version_info >= (3, 9):
def __new__(metacls: Type[_T], cls: str, bases: Tuple[type, ...], classdict: _EnumDict, **kwds: Any) -> _T: ... # type: ignore
else:
def __new__(metacls: Type[_T], cls: str, bases: Tuple[type, ...], classdict: _EnumDict) -> _T: ... # type: ignore
def __iter__(self: Type[_T]) -> Iterator[_T]: ...
def __reversed__(self: Type[_T]) -> Iterator[_T]: ...
def __contains__(self: Type[Any], member: object) -> bool: ...
@ -20,13 +52,56 @@ class EnumMeta(ABCMeta):
@_builtins_property
def __members__(self: Type[_T]) -> types.MappingProxyType[str, _T]: ...
def __len__(self) -> int: ...
if sys.version_info >= (3, 11):
# Simple value lookup
@overload # type: ignore[override]
def __call__(cls: Type[_T], value: Any, names: None = ...) -> _T: ...
# Functional Enum API
@overload
def __call__(
cls,
value: str,
names: _EnumNames,
*,
module: str | None = ...,
qualname: str | None = ...,
type: type | None = ...,
start: int = ...,
boundary: FlagBoundary | None = ...,
) -> Type[Enum]: ...
else:
@overload # type: ignore[override]
def __call__(cls: Type[_T], value: Any, names: None = ...) -> _T: ...
@overload
def __call__(
cls,
value: str,
names: _EnumNames,
*,
module: str | None = ...,
qualname: str | None = ...,
type: type | None = ...,
start: int = ...,
) -> Type[Enum]: ...
_member_names_: list[str] # undocumented
_member_map_: dict[str, Enum] # undocumented
_value2member_map_: dict[Any, Enum] # undocumented
if sys.version_info >= (3, 11):
# In 3.11 `EnumMeta` metaclass is renamed to `EnumType`, but old name also exists.
EnumType = EnumMeta
class Enum(metaclass=EnumMeta):
name: str
value: Any
if sys.version_info >= (3, 11):
@property
def name(self) -> str: ...
@property
def value(self) -> Any: ...
else:
@types.DynamicClassAttribute
def name(self) -> str: ...
@types.DynamicClassAttribute
def value(self) -> Any: ...
_name_: str
_value_: Any
if sys.version_info >= (3, 7):
@ -46,7 +121,13 @@ class Enum(metaclass=EnumMeta):
def __reduce_ex__(self, proto: object) -> Any: ...
class IntEnum(int, Enum):
value: int
_value_: int
if sys.version_info >= (3, 11):
@property
def value(self) -> int: ...
else:
@types.DynamicClassAttribute
def value(self) -> int: ...
def __new__(cls: Type[_T], value: int | _T) -> _T: ...
def unique(enumeration: _S) -> _S: ...
@ -55,12 +136,28 @@ _auto_null: Any
# subclassing IntFlag so it picks up all implemented base functions, best modeling behavior of enum.auto()
class auto(IntFlag):
value: Any
_value_: Any
if sys.version_info >= (3, 11):
@property
def value(self) -> Any: ...
else:
@types.DynamicClassAttribute
def value(self) -> Any: ...
def __new__(cls: Type[_T]) -> _T: ...
class Flag(Enum):
name: str | None # type: ignore[assignment]
value: int
_name_: str | None # type: ignore[assignment]
_value_: int
if sys.version_info >= (3, 11):
@property
def name(self) -> str | None: ... # type: ignore[override]
@property
def value(self) -> int: ...
else:
@types.DynamicClassAttribute
def name(self) -> str | None: ... # type: ignore[override]
@types.DynamicClassAttribute
def value(self) -> int: ...
def __contains__(self: _T, other: _T) -> bool: ...
def __repr__(self) -> str: ...
def __str__(self) -> str: ...
@ -81,7 +178,10 @@ class IntFlag(int, Flag):
if sys.version_info >= (3, 11):
class StrEnum(str, Enum):
def __new__(cls: Type[_T], value: int | _T) -> _T: ...
def __new__(cls: Type[_T], value: str | _T) -> _T: ...
_value_: str
@property
def value(self) -> str: ...
class FlagBoundary(StrEnum):
STRICT: str
CONFORM: str

View File

@ -33,10 +33,6 @@ class FTP:
lastresp: str
file: TextIO | None
encoding: str
# The following variable is intentionally left undocumented.
# See https://bugs.python.org/issue43285 for relevant discussion
# trust_server_pasv_ipv4_address: bool
def __enter__(self: Self) -> Self: ...
def __exit__(
self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None

View File

@ -1,6 +1,6 @@
import sys
import types
from _typeshed import SupportsItems, SupportsLessThan
from _typeshed import SupportsAllComparisons, SupportsItems
from typing import Any, Callable, Generic, Hashable, Iterable, NamedTuple, Sequence, Sized, Tuple, Type, TypeVar, overload
from typing_extensions import final
@ -45,7 +45,7 @@ WRAPPER_UPDATES: Sequence[str]
def update_wrapper(wrapper: _T, wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ...) -> _T: ...
def wraps(wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ...) -> Callable[[_T], _T]: ...
def total_ordering(cls: Type[_T]) -> Type[_T]: ...
def cmp_to_key(mycmp: Callable[[_T, _T], int]) -> Callable[[_T], SupportsLessThan]: ...
def cmp_to_key(mycmp: Callable[[_T, _T], int]) -> Callable[[_T], SupportsAllComparisons]: ...
class partial(Generic[_T]):
func: Callable[..., _T]

View File

@ -1,5 +1,5 @@
import os
from _typeshed import BytesPath, StrOrBytesPath, StrPath, SupportsLessThanT
from _typeshed import BytesPath, StrOrBytesPath, StrPath, SupportsRichComparisonT
from typing import Sequence, Tuple, overload
from typing_extensions import Literal
@ -11,9 +11,9 @@ def commonprefix(m: Sequence[StrPath]) -> str: ...
@overload
def commonprefix(m: Sequence[BytesPath]) -> bytes | Literal[""]: ...
@overload
def commonprefix(m: Sequence[list[SupportsLessThanT]]) -> Sequence[SupportsLessThanT]: ...
def commonprefix(m: Sequence[list[SupportsRichComparisonT]]) -> Sequence[SupportsRichComparisonT]: ...
@overload
def commonprefix(m: Sequence[Tuple[SupportsLessThanT, ...]]) -> Sequence[SupportsLessThanT]: ...
def commonprefix(m: Sequence[Tuple[SupportsRichComparisonT, ...]]) -> Sequence[SupportsRichComparisonT]: ...
def exists(path: StrOrBytesPath | int) -> bool: ...
def getsize(filename: StrOrBytesPath | int) -> int: ...
def isfile(path: StrOrBytesPath | int) -> bool: ...

View File

@ -1,10 +1,17 @@
from typing import NamedTuple
from _typeshed import structseq
from typing import Any, List, Optional, Tuple
from typing_extensions import final
class struct_group(NamedTuple):
gr_name: str
gr_passwd: str | None
gr_gid: int
gr_mem: list[str]
@final
class struct_group(structseq[Any], Tuple[str, Optional[str], int, List[str]]):
@property
def gr_name(self) -> str: ...
@property
def gr_passwd(self) -> str | None: ...
@property
def gr_gid(self) -> int: ...
@property
def gr_mem(self) -> list[str]: ...
def getgrall() -> list[struct_group]: ...
def getgrgid(id: int) -> struct_group: ...

View File

@ -1,4 +1,4 @@
from _typeshed import SupportsLessThan
from _typeshed import SupportsRichComparison
from typing import Any, Callable, Iterable, TypeVar
_T = TypeVar("_T")
@ -9,6 +9,6 @@ def heappushpop(__heap: list[_T], __item: _T) -> _T: ...
def heapify(__heap: list[Any]) -> None: ...
def heapreplace(__heap: list[_T], __item: _T) -> _T: ...
def merge(*iterables: Iterable[_T], key: Callable[[_T], Any] | None = ..., reverse: bool = ...) -> Iterable[_T]: ...
def nlargest(n: int, iterable: Iterable[_T], key: Callable[[_T], SupportsLessThan] | None = ...) -> list[_T]: ...
def nsmallest(n: int, iterable: Iterable[_T], key: Callable[[_T], SupportsLessThan] | None = ...) -> list[_T]: ...
def nlargest(n: int, iterable: Iterable[_T], key: Callable[[_T], SupportsRichComparison] | None = ...) -> list[_T]: ...
def nsmallest(n: int, iterable: Iterable[_T], key: Callable[[_T], SupportsRichComparison] | None = ...) -> list[_T]: ...
def _heapify_max(__x: list[Any]) -> None: ... # undocumented

View File

@ -12,8 +12,8 @@ from _typeshed import (
from abc import ABCMeta, abstractmethod
from importlib.machinery import ModuleSpec
from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper
from typing import IO, Any, BinaryIO, Iterator, Mapping, Protocol, Sequence, Union, overload
from typing_extensions import Literal, runtime_checkable
from typing import IO, Any, BinaryIO, Iterator, Mapping, NoReturn, Protocol, Sequence, Union, overload, runtime_checkable
from typing_extensions import Literal
_Path = Union[bytes, str]
@ -173,3 +173,10 @@ if sys.version_info >= (3, 9):
def read_bytes(self) -> bytes: ...
@abstractmethod
def read_text(self, encoding: str | None = ...) -> str: ...
class TraversableResources(ResourceReader):
@abstractmethod
def files(self) -> Traversable: ...
def open_resource(self, resource: StrPath) -> BufferedReader: ... # type: ignore[override]
def resource_path(self, resource: Any) -> NoReturn: ...
def is_resource(self, path: StrPath) -> bool: ...
def contents(self) -> Iterator[str]: ...

View File

@ -1,7 +1,10 @@
import importlib.abc
import sys
import types
from typing import Any, Callable, Sequence
from typing import Any, Callable, Iterable, Sequence
if sys.version_info >= (3, 8):
from importlib.metadata import DistributionFinder, PathDistribution
class ModuleSpec:
def __init__(
@ -97,6 +100,12 @@ class PathFinder:
else:
@classmethod
def invalidate_caches(cls) -> None: ...
if sys.version_info >= (3, 10):
@staticmethod
def find_distributions(context: DistributionFinder.Context = ...) -> Iterable[PathDistribution]: ...
elif sys.version_info >= (3, 8):
@classmethod
def find_distributions(cls, context: DistributionFinder.Context = ...) -> Iterable[PathDistribution]: ...
@classmethod
def find_spec(
cls, fullname: str, path: Sequence[bytes | str] | None = ..., target: types.ModuleType | None = ...

View File

@ -7,9 +7,10 @@ from email.message import Message
from importlib.abc import MetaPathFinder
from os import PathLike
from pathlib import Path
from typing import Any, Iterable, NamedTuple, Tuple, overload
from typing import Any, ClassVar, Iterable, NamedTuple, Pattern, Tuple, overload
if sys.version_info >= (3, 10):
from importlib.metadata._meta import PackageMetadata as PackageMetadata
def packages_distributions() -> Mapping[str, list[str]]: ...
if sys.version_info >= (3, 8):
@ -19,9 +20,18 @@ if sys.version_info >= (3, 8):
value: str
group: str
class EntryPoint(_EntryPointBase):
pattern: ClassVar[Pattern[str]]
def load(self) -> Any: ... # Callable[[], Any] or an importable module
@property
def extras(self) -> list[str]: ...
if sys.version_info >= (3, 9):
@property
def module(self) -> str: ...
@property
def attr(self) -> str: ...
if sys.version_info >= (3, 10):
dist: ClassVar[Distribution | None]
def matches(self, **params: Any) -> bool: ... # undocumented
class PackagePath(pathlib.PurePosixPath):
def read_text(self, encoding: str = ...) -> str: ...
def read_binary(self) -> bytes: ...
@ -61,6 +71,9 @@ if sys.version_info >= (3, 8):
def files(self) -> list[PackagePath] | None: ...
@property
def requires(self) -> list[str] | None: ...
if sys.version_info >= (3, 10):
@property
def name(self) -> str: ...
class DistributionFinder(MetaPathFinder):
class Context:
name: str | None

View File

@ -0,0 +1,18 @@
from typing import Any, Iterator, Protocol, TypeVar
_T = TypeVar("_T")
class PackageMetadata(Protocol):
def __len__(self) -> int: ...
def __contains__(self, item: str) -> bool: ...
def __getitem__(self, key: str) -> str: ...
def __iter__(self) -> Iterator[str]: ...
def get_all(self, name: str, failobj: _T = ...) -> list[Any] | _T: ...
@property
def json(self) -> dict[str, str | list[str]]: ...
class SimplePath(Protocol):
def joinpath(self) -> SimplePath: ...
def __div__(self) -> SimplePath: ...
def parent(self) -> SimplePath: ...
def read_text(self) -> str: ...

View File

@ -23,3 +23,6 @@ if sys.version_info >= (3, 9):
from importlib.abc import Traversable
def files(package: Package) -> Traversable: ...
def as_file(path: Traversable) -> AbstractContextManager[Path]: ...
if sys.version_info >= (3, 10):
from importlib.abc import ResourceReader as ResourceReader

View File

@ -1,5 +1,6 @@
import importlib.abc
import importlib.machinery
import sys
import types
from _typeshed import StrOrBytesPath
from typing import Any, Callable
@ -36,3 +37,6 @@ class LazyLoader(importlib.abc.Loader):
def factory(cls, loader: importlib.abc.Loader) -> Callable[..., LazyLoader]: ...
def create_module(self, spec: importlib.machinery.ModuleSpec) -> types.ModuleType | None: ...
def exec_module(self, module: types.ModuleType) -> None: ...
if sys.version_info >= (3, 7):
def source_hash(source_bytes: bytes) -> int: ...

View File

@ -3,7 +3,7 @@ import sys
import types
from _typeshed import Self
from collections import OrderedDict
from collections.abc import Awaitable, Callable, Generator, Mapping, Sequence
from collections.abc import Awaitable, Callable, Generator, Mapping, Sequence, Set as AbstractSet
from types import (
AsyncGeneratorType,
BuiltinFunctionType,
@ -205,7 +205,8 @@ class _ParameterKind(enum.IntEnum):
VAR_KEYWORD: int
if sys.version_info >= (3, 8):
description: str
@property
def description(self) -> str: ...
class Parameter:
def __init__(self, name: str, kind: _ParameterKind, *, default: Any = ..., annotation: Any = ...) -> None: ...
@ -317,7 +318,7 @@ class ClosureVars(NamedTuple):
nonlocals: Mapping[str, Any]
globals: Mapping[str, Any]
builtins: Mapping[str, Any]
unbound: set[str]
unbound: AbstractSet[str]
def getclosurevars(func: Callable[..., Any]) -> ClosureVars: ...
def unwrap(func: Callable[..., Any], *, stop: Callable[[Any], Any] | None = ...) -> Any: ...

View File

@ -1,6 +1,6 @@
import sys
import threading
from _typeshed import StrPath, SupportsWrite
from _typeshed import Self, StrPath, SupportsWrite
from collections.abc import Callable, Iterable, Mapping, MutableMapping, Sequence
from io import TextIOWrapper
from string import Template
@ -59,7 +59,7 @@ class Logger(Filterer):
def setLevel(self, level: _Level) -> None: ...
def isEnabledFor(self, level: int) -> bool: ...
def getEffectiveLevel(self) -> int: ...
def getChild(self, suffix: str) -> Logger: ...
def getChild(self: Self, suffix: str) -> Self: ... # see python/typing#980
if sys.version_info >= (3, 8):
def debug(
self,
@ -244,14 +244,14 @@ class Logger(Filterer):
def hasHandlers(self) -> bool: ...
def callHandlers(self, record: LogRecord) -> None: ... # undocumented
CRITICAL: int
FATAL: int
ERROR: int
WARNING: int
WARN: int
INFO: int
DEBUG: int
NOTSET: int
CRITICAL: Literal[50]
FATAL: Literal[50]
ERROR: Literal[40]
WARNING: Literal[30]
WARN: Literal[30]
INFO: Literal[20]
DEBUG: Literal[10]
NOTSET: Literal[0]
class Handler(Filterer):
level: int # undocumented

View File

@ -43,7 +43,12 @@ class _OptionalDictConfigArgs(TypedDict, total=False):
class _DictConfigArgs(_OptionalDictConfigArgs, TypedDict):
version: Literal[1]
def dictConfig(config: _DictConfigArgs) -> None: ...
# Accept dict[str, Any] to avoid false positives if called with a dict
# type, since dict types are not compatible with TypedDicts.
#
# Also accept a TypedDict type, to allow callers to use TypedDict
# types, and for somewhat stricter type checking of dict literals.
def dictConfig(config: _DictConfigArgs | dict[str, Any]) -> None: ...
if sys.version_info >= (3, 10):
def fileConfig(

View File

@ -9,6 +9,7 @@ from _typeshed import (
Self,
StrOrBytesPath,
StrPath,
structseq,
)
from builtins import OSError
from contextlib import AbstractContextManager
@ -26,7 +27,6 @@ from typing import (
List,
Mapping,
MutableMapping,
NamedTuple,
NoReturn,
Protocol,
Sequence,
@ -284,55 +284,75 @@ TMP_MAX: int # Undocumented, but used by tempfile
# ----- os classes (structures) -----
@final
class stat_result:
# For backward compatibility, the return value of stat() is also
# accessible as a tuple of at least 10 integers giving the most important
# (and portable) members of the stat structure, in the order st_mode,
# st_ino, st_dev, st_nlink, st_uid, st_gid, st_size, st_atime, st_mtime,
# st_ctime. More items may be added at the end by some implementations.
st_mode: int # protection bits,
st_ino: int # inode number,
st_dev: int # device,
st_nlink: int # number of hard links,
st_uid: int # user id of owner,
st_gid: int # group id of owner,
st_size: int # size of file, in bytes,
st_atime: float # time of most recent access,
st_mtime: float # time of most recent content modification,
st_ctime: float # platform dependent (time of most recent metadata change on Unix, or the time of creation on Windows)
st_atime_ns: int # time of most recent access, in nanoseconds
st_mtime_ns: int # time of most recent content modification in nanoseconds
st_ctime_ns: int # platform dependent (time of most recent metadata change on Unix, or the time of creation on Windows) in nanoseconds
if sys.version_info >= (3, 8) and sys.platform == "win32":
st_reparse_tag: int
class stat_result(structseq[float], Tuple[int, int, int, int, int, int, int, float, float, float]):
# The constructor of this class takes an iterable of variable length (though it must be at least 10).
#
# However, this class behaves like a tuple of 10 elements,
# no matter how long the iterable supplied to the constructor is.
# https://github.com/python/typeshed/pull/6560#discussion_r767162532
#
# The 10 elements always present are st_mode, st_ino, st_dev, st_nlink,
# st_uid, st_gid, st_size, st_atime, st_mtime, st_ctime.
#
# More items may be added at the end by some implementations.
@property
def st_mode(self) -> int: ... # protection bits,
@property
def st_ino(self) -> int: ... # inode number,
@property
def st_dev(self) -> int: ... # device,
@property
def st_nlink(self) -> int: ... # number of hard links,
@property
def st_uid(self) -> int: ... # user id of owner,
@property
def st_gid(self) -> int: ... # group id of owner,
@property
def st_size(self) -> int: ... # size of file, in bytes,
@property
def st_atime(self) -> float: ... # time of most recent access,
@property
def st_mtime(self) -> float: ... # time of most recent content modification,
# platform dependent (time of most recent metadata change on Unix, or the time of creation on Windows)
@property
def st_ctime(self) -> float: ...
@property
def st_atime_ns(self) -> int: ... # time of most recent access, in nanoseconds
@property
def st_mtime_ns(self) -> int: ... # time of most recent content modification in nanoseconds
# platform dependent (time of most recent metadata change on Unix, or the time of creation on Windows) in nanoseconds
@property
def st_ctime_ns(self) -> int: ...
if sys.platform == "win32":
st_file_attributes: int
def __getitem__(self, i: int) -> int: ...
# not documented
def __init__(self, tuple: Tuple[int, ...]) -> None: ...
# On some Unix systems (such as Linux), the following attributes may also
# be available:
st_blocks: int # number of blocks allocated for file
st_blksize: int # filesystem blocksize
st_rdev: int # type of device if an inode device
st_flags: int # user defined flags for file
@property
def st_file_attributes(self) -> int: ...
if sys.version_info >= (3, 8):
@property
def st_reparse_tag(self) -> int: ...
else:
@property
def st_blocks(self) -> int: ... # number of blocks allocated for file
@property
def st_blksize(self) -> int: ... # filesystem blocksize
@property
def st_rdev(self) -> int: ... # type of device if an inode device
if sys.platform != "linux":
# These properties are available on MacOS, but not on Windows or Ubuntu.
# On other Unix systems (such as FreeBSD), the following attributes may be
# available (but may be only filled out if root tries to use them):
st_gen: int # file generation number
st_birthtime: int # time of file creation
# On Mac OS systems, the following attributes may also be available:
st_rsize: int
st_creator: int
st_type: int
@property
def st_gen(self) -> int: ... # file generation number
@property
def st_birthtime(self) -> int: ... # time of file creation
if sys.platform == "darwin":
@property
def st_flags(self) -> int: ... # user defined flags for file
# Atributes documented as sometimes appearing, but deliberately omitted from the stub: `st_creator`, `st_rsize`, `st_type`.
# See https://github.com/python/typeshed/pull/6560#issuecomment-991253327
@runtime_checkable
class PathLike(Protocol[_AnyStr_co]):
def __fspath__(self) -> _AnyStr_co: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
@overload
def listdir(path: str | None = ...) -> list[str]: ...
@ -361,45 +381,55 @@ class DirEntry(Generic[AnyStr]):
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
if sys.platform != "win32":
_Tuple10Int = Tuple[int, int, int, int, int, int, int, int, int, int]
_Tuple11Int = Tuple[int, int, int, int, int, int, int, int, int, int, int]
if sys.version_info >= (3, 7):
# f_fsid was added in https://github.com/python/cpython/pull/4571
@final
class statvfs_result(_Tuple10Int): # Unix only
def __new__(cls, seq: _Tuple10Int | _Tuple11Int, dict: dict[str, int] = ...) -> statvfs_result: ...
n_fields: int
n_sequence_fields: int
n_unnamed_fields: int
class statvfs_result(structseq[int], Tuple[int, int, int, int, int, int, int, int, int, int, int]):
@property
def f_bsize(self) -> int: ...
@property
def f_frsize(self) -> int: ...
@property
def f_blocks(self) -> int: ...
@property
def f_bfree(self) -> int: ...
@property
def f_bavail(self) -> int: ...
@property
def f_files(self) -> int: ...
@property
def f_ffree(self) -> int: ...
@property
def f_favail(self) -> int: ...
@property
def f_flag(self) -> int: ...
@property
def f_namemax(self) -> int: ...
@property
def f_fsid(self) -> int: ...
f_bsize: int
f_frsize: int
f_blocks: int
f_bfree: int
f_bavail: int
f_files: int
f_ffree: int
f_favail: int
f_flag: int
f_namemax: int
f_fsid: int
else:
class statvfs_result(_Tuple10Int): # Unix only
n_fields: int
n_sequence_fields: int
n_unnamed_fields: int
f_bsize: int
f_frsize: int
f_blocks: int
f_bfree: int
f_bavail: int
f_files: int
f_ffree: int
f_favail: int
f_flag: int
f_namemax: int
@final
class statvfs_result(structseq[int], Tuple[int, int, int, int, int, int, int, int, int, int]):
@property
def f_bsize(self) -> int: ...
@property
def f_frsize(self) -> int: ...
@property
def f_blocks(self) -> int: ...
@property
def f_bfree(self) -> int: ...
@property
def f_bavail(self) -> int: ...
@property
def f_files(self) -> int: ...
@property
def f_ffree(self) -> int: ...
@property
def f_favail(self) -> int: ...
@property
def f_flag(self) -> int: ...
@property
def f_namemax(self) -> int: ...
# ----- os function stubs -----
def fsencode(filename: StrOrBytesPath) -> bytes: ...
@ -416,6 +446,18 @@ def getpid() -> int: ...
def getppid() -> int: ...
def strerror(__code: int) -> str: ...
def umask(__mask: int) -> int: ...
@final
class uname_result(structseq[str], Tuple[str, str, str, str, str]):
@property
def sysname(self) -> str: ...
@property
def nodename(self) -> str: ...
@property
def release(self) -> str: ...
@property
def version(self) -> str: ...
@property
def machine(self) -> str: ...
if sys.platform != "win32":
def ctermid() -> str: ...
@ -447,13 +489,6 @@ if sys.platform != "win32":
def getsid(__pid: int) -> int: ...
def setsid() -> None: ...
def setuid(__uid: int) -> None: ...
@final
class uname_result(NamedTuple):
sysname: str
nodename: str
release: str
version: str
machine: str
def uname() -> uname_result: ...
@overload
@ -469,7 +504,7 @@ if sys.platform != "win32":
def putenv(__name: bytes | str, __value: bytes | str) -> None: ...
if sys.platform != "win32":
if sys.platform != "win32" or sys.version_info >= (3, 9):
def unsetenv(__name: bytes | str) -> None: ...
_Opener = Callable[[str, int], int]
@ -563,7 +598,9 @@ else:
def dup2(fd: int, fd2: int, inheritable: bool = ...) -> None: ...
def fstat(fd: int) -> stat_result: ...
def ftruncate(__fd: int, __length: int) -> None: ...
def fsync(fd: FileDescriptorLike) -> None: ...
def isatty(__fd: int) -> bool: ...
def lseek(__fd: int, __position: int, __how: int) -> int: ...
def open(path: StrOrBytesPath, flags: int, mode: int = ..., *, dir_fd: int | None = ...) -> int: ...
def pipe() -> tuple[int, int]: ...
@ -573,18 +610,15 @@ if sys.platform != "win32":
# Unix only
def fchmod(fd: int, mode: int) -> None: ...
def fchown(fd: int, uid: int, gid: int) -> None: ...
if sys.platform != "darwin":
def fdatasync(fd: FileDescriptorLike) -> None: ... # Unix only, not Mac
def fpathconf(__fd: int, __name: str | int) -> int: ...
def fstatvfs(__fd: int) -> statvfs_result: ...
def ftruncate(__fd: int, __length: int) -> None: ...
def get_blocking(__fd: int) -> bool: ...
def set_blocking(__fd: int, __blocking: bool) -> None: ...
def isatty(__fd: int) -> bool: ...
def lockf(__fd: int, __command: int, __length: int) -> None: ...
def openpty() -> tuple[int, int]: ... # some flavors of Unix
if sys.platform != "darwin":
def pipe2(flags: int) -> tuple[int, int]: ... # some flavors of Unix
def fdatasync(fd: FileDescriptorLike) -> None: ...
def pipe2(__flags: int) -> tuple[int, int]: ... # some flavors of Unix
def posix_fallocate(fd: int, offset: int, length: int) -> None: ...
def posix_fadvise(fd: int, offset: int, length: int, advice: int) -> None: ...
def pread(__fd: int, __length: int, __offset: int) -> bytes: ...
@ -605,9 +639,11 @@ if sys.platform != "win32":
def writev(__fd: int, __buffers: Sequence[bytes]) -> int: ...
@final
class terminal_size(Tuple[int, int]):
columns: int
lines: int
class terminal_size(structseq[int], Tuple[int, int]):
@property
def columns(self) -> int: ...
@property
def lines(self) -> int: ...
def get_terminal_size(fd: int = ...) -> terminal_size: ...
def get_inheritable(__fd: int) -> bool: ...
@ -632,17 +668,14 @@ def getcwd() -> str: ...
def getcwdb() -> bytes: ...
def chmod(path: _FdOrAnyPath, mode: int, *, dir_fd: int | None = ..., follow_symlinks: bool = ...) -> None: ...
if sys.platform != "win32":
if sys.platform != "win32" and sys.platform != "linux":
def chflags(path: StrOrBytesPath, flags: int, follow_symlinks: bool = ...) -> None: ... # some flavors of Unix
def chown(
path: _FdOrAnyPath, uid: int, gid: int, *, dir_fd: int | None = ..., follow_symlinks: bool = ...
) -> None: ... # Unix only
if sys.platform != "win32":
# Unix only
def chroot(path: StrOrBytesPath) -> None: ...
def lchflags(path: StrOrBytesPath, flags: int) -> None: ...
def lchmod(path: StrOrBytesPath, mode: int) -> None: ...
if sys.platform != "win32":
def chroot(path: StrOrBytesPath) -> None: ...
def chown(path: _FdOrAnyPath, uid: int, gid: int, *, dir_fd: int | None = ..., follow_symlinks: bool = ...) -> None: ...
def lchown(path: StrOrBytesPath, uid: int, gid: int) -> None: ...
def link(
@ -825,12 +858,17 @@ else:
def system(command: StrOrBytesPath) -> int: ...
@final
class times_result(NamedTuple):
user: float
system: float
children_user: float
children_system: float
elapsed: float
class times_result(structseq[float], Tuple[float, float, float, float, float]):
@property
def user(self) -> float: ...
@property
def system(self) -> float: ...
@property
def children_user(self) -> float: ...
@property
def children_system(self) -> float: ...
@property
def elapsed(self) -> float: ...
def times() -> times_result: ...
def waitpid(__pid: int, __options: int) -> tuple[int, int]: ...
@ -845,12 +883,18 @@ else:
def spawnvpe(mode: int, file: StrOrBytesPath, args: _ExecVArgs, env: _ExecEnv) -> int: ...
def wait() -> tuple[int, int]: ... # Unix only
if sys.platform != "darwin":
class waitid_result(NamedTuple):
si_pid: int
si_uid: int
si_signo: int
si_status: int
si_code: int
@final
class waitid_result(structseq[int], Tuple[int, int, int, int, int]):
@property
def si_pid(self) -> int: ...
@property
def si_uid(self) -> int: ...
@property
def si_signo(self) -> int: ...
@property
def si_status(self) -> int: ...
@property
def si_code(self) -> int: ...
def waitid(idtype: int, ident: int, options: int) -> waitid_result: ...
def wait3(options: int) -> tuple[int, int, Any]: ...
def wait4(pid: int, options: int) -> tuple[int, int, Any]: ...
@ -891,8 +935,11 @@ else:
) -> int: ...
if sys.platform != "win32":
class sched_param(NamedTuple):
sched_priority: int
@final
class sched_param(structseq[int], Tuple[int]):
def __new__(cls, sched_priority: int) -> sched_param: ...
@property
def sched_priority(self) -> int: ...
def sched_get_priority_min(policy: int) -> int: ... # some flavors of Unix
def sched_get_priority_max(policy: int) -> int: ... # some flavors of Unix
def sched_yield() -> None: ... # some flavors of Unix

View File

@ -87,10 +87,137 @@ if sys.platform != "win32":
WTERMSIG as WTERMSIG,
WUNTRACED as WUNTRACED,
X_OK as X_OK,
DirEntry as DirEntry,
_exit as _exit,
abort as abort,
access as access,
chdir as chdir,
chmod as chmod,
chown as chown,
chroot as chroot,
close as close,
closerange as closerange,
confstr as confstr,
confstr_names as confstr_names,
cpu_count as cpu_count,
ctermid as ctermid,
device_encoding as device_encoding,
dup as dup,
dup2 as dup2,
error as error,
execv as execv,
execve as execve,
fchdir as fchdir,
fchmod as fchmod,
fchown as fchown,
fork as fork,
forkpty as forkpty,
fpathconf as fpathconf,
fspath as fspath,
fstat as fstat,
fstatvfs as fstatvfs,
fsync as fsync,
ftruncate as ftruncate,
get_blocking as get_blocking,
get_inheritable as get_inheritable,
get_terminal_size as get_terminal_size,
getcwd as getcwd,
getcwdb as getcwdb,
getegid as getegid,
geteuid as geteuid,
getgid as getgid,
getgrouplist as getgrouplist,
getgroups as getgroups,
getloadavg as getloadavg,
getlogin as getlogin,
getpgid as getpgid,
getpgrp as getpgrp,
getpid as getpid,
getppid as getppid,
getpriority as getpriority,
getsid as getsid,
getuid as getuid,
initgroups as initgroups,
isatty as isatty,
kill as kill,
killpg as killpg,
lchown as lchown,
link as link,
listdir as listdir,
lockf as lockf,
lseek as lseek,
lstat as lstat,
major as major,
makedev as makedev,
minor as minor,
mkdir as mkdir,
mkfifo as mkfifo,
mknod as mknod,
nice as nice,
open as open,
openpty as openpty,
pathconf as pathconf,
pathconf_names as pathconf_names,
pipe as pipe,
pread as pread,
putenv as putenv,
pwrite as pwrite,
read as read,
readlink as readlink,
readv as readv,
remove as remove,
rename as rename,
replace as replace,
rmdir as rmdir,
scandir as scandir,
sched_get_priority_max as sched_get_priority_max,
sched_get_priority_min as sched_get_priority_min,
sched_param as sched_param,
sched_yield as sched_yield,
sendfile as sendfile,
set_blocking as set_blocking,
set_inheritable as set_inheritable,
setegid as setegid,
seteuid as seteuid,
setgid as setgid,
setgroups as setgroups,
setpgid as setpgid,
setpgrp as setpgrp,
setpriority as setpriority,
setregid as setregid,
setreuid as setreuid,
setsid as setsid,
setuid as setuid,
stat as stat,
stat_result as stat_result,
statvfs as statvfs,
statvfs_result as statvfs_result,
strerror as strerror,
symlink as symlink,
sync as sync,
sysconf as sysconf,
sysconf_names as sysconf_names,
system as system,
tcgetpgrp as tcgetpgrp,
tcsetpgrp as tcsetpgrp,
terminal_size as terminal_size,
times as times,
times_result as times_result,
truncate as truncate,
ttyname as ttyname,
umask as umask,
uname as uname,
uname_result as uname_result,
unlink as unlink,
unsetenv as unsetenv,
urandom as urandom,
utime as utime,
wait as wait,
wait3 as wait3,
wait4 as wait4,
waitpid as waitpid,
write as write,
writev as writev,
)
if sys.platform == "linux":
@ -101,7 +228,15 @@ if sys.platform != "win32":
XATTR_CREATE as XATTR_CREATE,
XATTR_REPLACE as XATTR_REPLACE,
XATTR_SIZE_MAX as XATTR_SIZE_MAX,
getrandom as getrandom,
getxattr as getxattr,
listxattr as listxattr,
removexattr as removexattr,
setxattr as setxattr,
)
else:
from os import chflags as chflags, lchflags as lchflags, lchmod as lchmod
if sys.platform != "darwin":
from os import (
POSIX_FADV_DONTNEED as POSIX_FADV_DONTNEED,
@ -110,11 +245,54 @@ if sys.platform != "win32":
POSIX_FADV_RANDOM as POSIX_FADV_RANDOM,
POSIX_FADV_SEQUENTIAL as POSIX_FADV_SEQUENTIAL,
POSIX_FADV_WILLNEED as POSIX_FADV_WILLNEED,
fdatasync as fdatasync,
getresgid as getresgid,
getresuid as getresuid,
pipe2 as pipe2,
posix_fadvise as posix_fadvise,
posix_fallocate as posix_fallocate,
sched_getaffinity as sched_getaffinity,
sched_getparam as sched_getparam,
sched_getscheduler as sched_getscheduler,
sched_rr_get_interval as sched_rr_get_interval,
sched_setaffinity as sched_setaffinity,
sched_setparam as sched_setparam,
sched_setscheduler as sched_setscheduler,
setresgid as setresgid,
setresuid as setresuid,
waitid as waitid,
waitid_result as waitid_result,
)
if sys.version_info >= (3, 9):
from os import waitstatus_to_exitcode as waitstatus_to_exitcode
if sys.version_info >= (3, 8):
from os import posix_spawn as posix_spawn, posix_spawnp as posix_spawnp
if sys.platform == "linux":
from os import (
MFD_ALLOW_SEALING as MFD_ALLOW_SEALING,
MFD_CLOEXEC as MFD_CLOEXEC,
MFD_HUGE_1GB as MFD_HUGE_1GB,
MFD_HUGE_1MB as MFD_HUGE_1MB,
MFD_HUGE_2GB as MFD_HUGE_2GB,
MFD_HUGE_2MB as MFD_HUGE_2MB,
MFD_HUGE_8MB as MFD_HUGE_8MB,
MFD_HUGE_16GB as MFD_HUGE_16GB,
MFD_HUGE_16MB as MFD_HUGE_16MB,
MFD_HUGE_32MB as MFD_HUGE_32MB,
MFD_HUGE_64KB as MFD_HUGE_64KB,
MFD_HUGE_256MB as MFD_HUGE_256MB,
MFD_HUGE_512KB as MFD_HUGE_512KB,
MFD_HUGE_512MB as MFD_HUGE_512MB,
MFD_HUGE_MASK as MFD_HUGE_MASK,
MFD_HUGE_SHIFT as MFD_HUGE_SHIFT,
MFD_HUGETLB as MFD_HUGETLB,
memfd_create as memfd_create,
)
if sys.version_info >= (3, 7):
from os import register_at_fork as register_at_fork
# Not same as os.environ or os.environb
# Because of this variable, we can't do "from posix import *" in os/__init__.pyi
environ: dict[bytes, bytes]

View File

@ -1,17 +1,23 @@
from typing import ClassVar, Tuple
from _typeshed import structseq
from typing import Any, Tuple
from typing_extensions import final
class struct_passwd(Tuple[str, str, int, int, str, str, str]):
pw_name: str
pw_passwd: str
pw_uid: int
pw_gid: int
pw_gecos: str
pw_dir: str
pw_shell: str
n_fields: ClassVar[int]
n_sequence_fields: ClassVar[int]
n_unnamed_fields: ClassVar[int]
@final
class struct_passwd(structseq[Any], Tuple[str, str, int, int, str, str, str]):
@property
def pw_name(self) -> str: ...
@property
def pw_passwd(self) -> str: ...
@property
def pw_uid(self) -> int: ...
@property
def pw_gid(self) -> int: ...
@property
def pw_gecos(self) -> str: ...
@property
def pw_dir(self) -> str: ...
@property
def pw_shell(self) -> str: ...
def getpwall() -> list[struct_passwd]: ...
def getpwuid(__uid: int) -> struct_passwd: ...

View File

@ -109,7 +109,7 @@ class HTMLDoc(Doc):
*ignored: Any,
) -> str: ...
def formatvalue(self, object: object) -> str: ...
def docroutine(
def docroutine( # type: ignore[override]
self,
object: object,
name: str | None = ...,
@ -118,15 +118,10 @@ class HTMLDoc(Doc):
classes: Mapping[str, str] = ...,
methods: Mapping[str, str] = ...,
cl: type | None = ...,
*ignored: Any,
) -> str: ...
def docproperty(
self, object: object, name: str | None = ..., mod: str | None = ..., cl: Any | None = ..., *ignored: Any
) -> str: ...
def docproperty(self, object: object, name: str | None = ..., mod: str | None = ..., cl: Any | None = ...) -> str: ... # type: ignore[override]
def docother(self, object: object, name: str | None = ..., mod: Any | None = ..., *ignored: Any) -> str: ...
def docdata(
self, object: object, name: str | None = ..., mod: Any | None = ..., cl: Any | None = ..., *ignored: Any
) -> str: ...
def docdata(self, object: object, name: str | None = ..., mod: Any | None = ..., cl: Any | None = ...) -> str: ... # type: ignore[override]
def index(self, dir: str, shadowed: MutableMapping[str, bool] | None = ...) -> str: ...
def filelink(self, url: str, path: str) -> str: ...
@ -150,19 +145,13 @@ class TextDoc(Doc):
def formattree(
self, tree: list[tuple[type, Tuple[type, ...]] | list[Any]], modname: str, parent: type | None = ..., prefix: str = ...
) -> str: ...
def docmodule(self, object: object, name: str | None = ..., mod: Any | None = ..., *ignored: Any) -> str: ...
def docmodule(self, object: object, name: str | None = ..., mod: Any | None = ...) -> str: ... # type: ignore[override]
def docclass(self, object: object, name: str | None = ..., mod: str | None = ..., *ignored: Any) -> str: ...
def formatvalue(self, object: object) -> str: ...
def docroutine(
self, object: object, name: str | None = ..., mod: str | None = ..., cl: Any | None = ..., *ignored: Any
) -> str: ...
def docproperty(
self, object: object, name: str | None = ..., mod: Any | None = ..., cl: Any | None = ..., *ignored: Any
) -> str: ...
def docdata(
self, object: object, name: str | None = ..., mod: str | None = ..., cl: Any | None = ..., *ignored: Any
) -> str: ...
def docother(
def docroutine(self, object: object, name: str | None = ..., mod: str | None = ..., cl: Any | None = ...) -> str: ... # type: ignore[override]
def docproperty(self, object: object, name: str | None = ..., mod: Any | None = ..., cl: Any | None = ...) -> str: ... # type: ignore[override]
def docdata(self, object: object, name: str | None = ..., mod: str | None = ..., cl: Any | None = ...) -> str: ... # type: ignore[override]
def docother( # type: ignore[override]
self,
object: object,
name: str | None = ...,
@ -170,7 +159,6 @@ class TextDoc(Doc):
parent: str | None = ...,
maxlen: int | None = ...,
doc: Any | None = ...,
*ignored: Any,
) -> str: ...
def pager(text: str) -> None: ...

View File

@ -1,12 +1,14 @@
import _random
import sys
from collections.abc import Callable, Iterable, MutableSequence, Sequence
from _typeshed import SupportsLenAndGetItem
from collections.abc import Callable, Iterable, MutableSequence, Sequence, Set as AbstractSet
from fractions import Fraction
from typing import Any, NoReturn, Tuple, TypeVar
from typing import Any, ClassVar, NoReturn, Tuple, TypeVar
_T = TypeVar("_T")
class Random(_random.Random):
VERSION: ClassVar[int]
def __init__(self, x: Any = ...) -> None: ...
def seed(self, a: Any = ..., version: int = ...) -> None: ...
def getstate(self) -> Tuple[Any, ...]: ...
@ -16,10 +18,10 @@ class Random(_random.Random):
def randint(self, a: int, b: int) -> int: ...
if sys.version_info >= (3, 9):
def randbytes(self, n: int) -> bytes: ...
def choice(self, seq: Sequence[_T]) -> _T: ...
def choice(self, seq: SupportsLenAndGetItem[_T]) -> _T: ...
def choices(
self,
population: Sequence[_T],
population: SupportsLenAndGetItem[_T],
weights: Sequence[float | Fraction] | None = ...,
*,
cum_weights: Sequence[float | Fraction] | None = ...,
@ -27,9 +29,11 @@ class Random(_random.Random):
) -> list[_T]: ...
def shuffle(self, x: MutableSequence[Any], random: Callable[[], float] | None = ...) -> None: ...
if sys.version_info >= (3, 9):
def sample(self, population: Sequence[_T] | set[_T], k: int, *, counts: Iterable[_T] | None = ...) -> list[_T]: ...
def sample(
self, population: Sequence[_T] | AbstractSet[_T], k: int, *, counts: Iterable[_T] | None = ...
) -> list[_T]: ...
else:
def sample(self, population: Sequence[_T] | set[_T], k: int) -> list[_T]: ...
def sample(self, population: Sequence[_T] | AbstractSet[_T], k: int) -> list[_T]: ...
def random(self) -> float: ...
def uniform(self, a: float, b: float) -> float: ...
def triangular(self, low: float = ..., high: float = ..., mode: float | None = ...) -> float: ...
@ -45,6 +49,7 @@ class Random(_random.Random):
# SystemRandom is not implemented for all OS's; good on Windows & Linux
class SystemRandom(Random):
def getrandbits(self, k: int) -> int: ... # k can be passed by keyword
def getstate(self, *args: Any, **kwds: Any) -> NoReturn: ...
def setstate(self, *args: Any, **kwds: Any) -> NoReturn: ...
@ -59,17 +64,21 @@ def randint(a: int, b: int) -> int: ...
if sys.version_info >= (3, 9):
def randbytes(n: int) -> bytes: ...
def choice(seq: Sequence[_T]) -> _T: ...
def choice(seq: SupportsLenAndGetItem[_T]) -> _T: ...
def choices(
population: Sequence[_T], weights: Sequence[float] | None = ..., *, cum_weights: Sequence[float] | None = ..., k: int = ...
population: SupportsLenAndGetItem[_T],
weights: Sequence[float] | None = ...,
*,
cum_weights: Sequence[float] | None = ...,
k: int = ...,
) -> list[_T]: ...
def shuffle(x: MutableSequence[Any], random: Callable[[], float] | None = ...) -> None: ...
if sys.version_info >= (3, 9):
def sample(population: Sequence[_T] | set[_T], k: int, *, counts: Iterable[_T] | None = ...) -> list[_T]: ...
def sample(population: Sequence[_T] | AbstractSet[_T], k: int, *, counts: Iterable[_T] | None = ...) -> list[_T]: ...
else:
def sample(population: Sequence[_T] | set[_T], k: int) -> list[_T]: ...
def sample(population: Sequence[_T] | AbstractSet[_T], k: int) -> list[_T]: ...
def random() -> float: ...
def uniform(a: float, b: float) -> float: ...

View File

@ -1,5 +1,7 @@
import sys
from typing import Any, Tuple, overload
from _typeshed import structseq
from typing import Tuple, overload
from typing_extensions import final
RLIMIT_AS: int
RLIMIT_CORE: int
@ -23,26 +25,40 @@ if sys.platform == "linux":
RLIMIT_SIGPENDING: int
RUSAGE_THREAD: int
_Tuple16 = Tuple[float, float, int, int, int, int, int, int, int, int, int, int, int, int, int, int]
class struct_rusage(_Tuple16):
def __new__(cls, sequence: _Tuple16, dict: dict[str, Any] = ...) -> struct_rusage: ...
ru_utime: float
ru_stime: float
ru_maxrss: int
ru_ixrss: int
ru_idrss: int
ru_isrss: int
ru_minflt: int
ru_majflt: int
ru_nswap: int
ru_inblock: int
ru_oublock: int
ru_msgsnd: int
ru_msgrcv: int
ru_nsignals: int
ru_nvcsw: int
ru_nivcsw: int
@final
class struct_rusage(structseq[float], Tuple[float, float, int, int, int, int, int, int, int, int, int, int, int, int, int, int]):
@property
def ru_utime(self) -> float: ...
@property
def ru_stime(self) -> float: ...
@property
def ru_maxrss(self) -> int: ...
@property
def ru_ixrss(self) -> int: ...
@property
def ru_idrss(self) -> int: ...
@property
def ru_isrss(self) -> int: ...
@property
def ru_minflt(self) -> int: ...
@property
def ru_majflt(self) -> int: ...
@property
def ru_nswap(self) -> int: ...
@property
def ru_inblock(self) -> int: ...
@property
def ru_oublock(self) -> int: ...
@property
def ru_msgsnd(self) -> int: ...
@property
def ru_msgrcv(self) -> int: ...
@property
def ru_nsignals(self) -> int: ...
@property
def ru_nvcsw(self) -> int: ...
@property
def ru_nivcsw(self) -> int: ...
def getpagesize() -> int: ...
def getrlimit(__resource: int) -> tuple[int, int]: ...

View File

@ -1,12 +1,13 @@
from _typeshed import SupportsLenAndGetItem
from hmac import compare_digest as compare_digest
from random import SystemRandom as SystemRandom
from typing import Sequence, TypeVar
from typing import TypeVar
_T = TypeVar("_T")
def randbelow(exclusive_upper_bound: int) -> int: ...
def randbits(k: int) -> int: ...
def choice(seq: Sequence[_T]) -> _T: ...
def choice(seq: SupportsLenAndGetItem[_T]) -> _T: ...
def token_bytes(nbytes: int | None = ...) -> bytes: ...
def token_hex(nbytes: int | None = ...) -> str: ...
def token_urlsafe(nbytes: int | None = ...) -> str: ...

View File

@ -1,56 +1,40 @@
import sys
from _typeshed import structseq
from enum import IntEnum
from types import FrameType
from typing import Any, Callable, Iterable, Optional, Tuple, Union
if sys.platform != "win32":
class ItimerError(IOError): ...
ITIMER_PROF: int
ITIMER_REAL: int
ITIMER_VIRTUAL: int
from typing_extensions import final
NSIG: int
class Signals(IntEnum):
SIGABRT: int
if sys.platform != "win32":
SIGALRM: int
if sys.platform == "win32":
SIGBREAK: int
if sys.platform != "win32":
SIGBUS: int
SIGCHLD: int
if sys.platform != "darwin" and sys.platform != "win32":
SIGCLD: int
if sys.platform != "win32":
SIGCONT: int
SIGEMT: int
SIGFPE: int
if sys.platform != "win32":
SIGHUP: int
SIGILL: int
SIGINFO: int
SIGINT: int
if sys.platform != "win32":
SIGSEGV: int
SIGTERM: int
if sys.platform == "win32":
SIGBREAK: int
CTRL_C_EVENT: int
CTRL_BREAK_EVENT: int
else:
SIGALRM: int
SIGBUS: int
SIGCHLD: int
SIGCONT: int
SIGHUP: int
SIGIO: int
SIGIOT: int
SIGKILL: int
SIGPIPE: int
if sys.platform != "darwin" and sys.platform != "win32":
SIGPOLL: int
SIGPWR: int
if sys.platform != "win32":
SIGPROF: int
SIGQUIT: int
if sys.platform != "darwin" and sys.platform != "win32":
SIGRTMAX: int
SIGRTMIN: int
SIGSEGV: int
if sys.platform != "win32":
SIGSTOP: int
SIGSYS: int
SIGTERM: int
if sys.platform != "win32":
SIGTRAP: int
SIGTSTP: int
SIGTTIN: int
@ -62,65 +46,54 @@ class Signals(IntEnum):
SIGWINCH: int
SIGXCPU: int
SIGXFSZ: int
if sys.platform != "darwin":
SIGCLD: int
SIGPOLL: int
SIGPWR: int
SIGRTMAX: int
SIGRTMIN: int
class Handlers(IntEnum):
SIG_DFL: int
SIG_IGN: int
SIG_DFL = Handlers.SIG_DFL
SIG_IGN = Handlers.SIG_IGN
if sys.platform != "win32":
class Sigmasks(IntEnum):
SIG_BLOCK: int
SIG_UNBLOCK: int
SIG_SETMASK: int
SIG_BLOCK = Sigmasks.SIG_BLOCK
SIG_UNBLOCK = Sigmasks.SIG_UNBLOCK
SIG_SETMASK = Sigmasks.SIG_SETMASK
SIG_DFL: Handlers
SIG_IGN: Handlers
_SIGNUM = Union[int, Signals]
_HANDLER = Union[Callable[[int, Optional[FrameType]], Any], int, Handlers, None]
def default_int_handler(signum: int, frame: FrameType | None) -> None: ...
def getsignal(__signalnum: _SIGNUM) -> _HANDLER: ...
def signal(__signalnum: _SIGNUM, __handler: _HANDLER) -> _HANDLER: ...
SIGABRT: Signals
if sys.platform != "win32":
SIGALRM: Signals
if sys.platform == "win32":
SIGBREAK: Signals
if sys.platform != "win32":
SIGBUS: Signals
SIGCHLD: Signals
if sys.platform != "darwin" and sys.platform != "win32":
SIGCLD: Signals
if sys.platform != "win32":
SIGCONT: Signals
SIGEMT: Signals
SIGFPE: Signals
if sys.platform != "win32":
SIGHUP: Signals
SIGILL: Signals
SIGINFO: Signals
SIGINT: Signals
if sys.platform != "win32":
SIGSEGV: Signals
SIGTERM: Signals
if sys.platform == "win32":
SIGBREAK: Signals
CTRL_C_EVENT: Signals
CTRL_BREAK_EVENT: Signals
else:
SIGALRM: Signals
SIGBUS: Signals
SIGCHLD: Signals
SIGCONT: Signals
SIGHUP: Signals
SIGIO: Signals
SIGIOT: Signals
SIGKILL: Signals
SIGPIPE: Signals
if sys.platform != "darwin" and sys.platform != "win32":
SIGPOLL: Signals
SIGPWR: Signals
if sys.platform != "win32":
SIGPROF: Signals
SIGQUIT: Signals
if sys.platform != "darwin" and sys.platform != "win32":
SIGRTMAX: Signals
SIGRTMIN: Signals
SIGSEGV: Signals
if sys.platform != "win32":
SIGSTOP: Signals
SIGSYS: Signals
SIGTERM: Signals
if sys.platform != "win32":
SIGTRAP: Signals
SIGTSTP: Signals
SIGTTIN: Signals
@ -132,14 +105,34 @@ if sys.platform != "win32":
SIGWINCH: Signals
SIGXCPU: Signals
SIGXFSZ: Signals
if sys.platform == "win32":
CTRL_C_EVENT: int
CTRL_BREAK_EVENT: int
if sys.platform != "win32" and sys.platform != "darwin":
class struct_siginfo(Tuple[int, int, int, int, int, int, int]):
def __init__(self, sequence: Iterable[int]) -> None: ...
class ItimerError(IOError): ...
ITIMER_PROF: int
ITIMER_REAL: int
ITIMER_VIRTUAL: int
class Sigmasks(IntEnum):
SIG_BLOCK: int
SIG_UNBLOCK: int
SIG_SETMASK: int
SIG_BLOCK = Sigmasks.SIG_BLOCK
SIG_UNBLOCK = Sigmasks.SIG_UNBLOCK
SIG_SETMASK = Sigmasks.SIG_SETMASK
def alarm(__seconds: int) -> int: ...
def getitimer(__which: int) -> tuple[float, float]: ...
def pause() -> None: ...
def pthread_kill(__thread_id: int, __signalnum: int) -> None: ...
def pthread_sigmask(__how: int, __mask: Iterable[int]) -> set[_SIGNUM]: ...
def setitimer(__which: int, __seconds: float, __interval: float = ...) -> tuple[float, float]: ...
def siginterrupt(__signalnum: int, __flag: bool) -> None: ...
def sigpending() -> Any: ...
def sigwait(__sigset: Iterable[int]) -> _SIGNUM: ...
if sys.platform != "darwin":
SIGCLD: Signals
SIGPOLL: Signals
SIGPWR: Signals
SIGRTMAX: Signals
SIGRTMIN: Signals
@final
class struct_siginfo(structseq[int], Tuple[int, int, int, int, int, int, int]):
@property
def si_signo(self) -> int: ...
@property
@ -154,42 +147,16 @@ if sys.platform != "win32" and sys.platform != "darwin":
def si_status(self) -> int: ...
@property
def si_band(self) -> int: ...
if sys.platform != "win32":
def alarm(__seconds: int) -> int: ...
def default_int_handler(signum: int, frame: FrameType) -> None: ...
if sys.platform != "win32":
def getitimer(__which: int) -> tuple[float, float]: ...
def getsignal(__signalnum: _SIGNUM) -> _HANDLER: ...
def sigtimedwait(sigset: Iterable[int], timeout: float) -> struct_siginfo | None: ...
def sigwaitinfo(sigset: Iterable[int]) -> struct_siginfo: ...
if sys.version_info >= (3, 8):
def strsignal(__signalnum: _SIGNUM) -> str | None: ...
def valid_signals() -> set[Signals]: ...
def raise_signal(__signalnum: _SIGNUM) -> None: ...
if sys.platform != "win32":
def pause() -> None: ...
def pthread_kill(__thread_id: int, __signalnum: int) -> None: ...
def pthread_sigmask(__how: int, __mask: Iterable[int]) -> set[_SIGNUM]: ...
if sys.version_info >= (3, 7):
def set_wakeup_fd(fd: int, *, warn_on_full_buffer: bool = ...) -> int: ...
else:
def set_wakeup_fd(fd: int) -> int: ...
if sys.platform != "win32":
def setitimer(__which: int, __seconds: float, __interval: float = ...) -> tuple[float, float]: ...
def siginterrupt(__signalnum: int, __flag: bool) -> None: ...
def signal(__signalnum: _SIGNUM, __handler: _HANDLER) -> _HANDLER: ...
if sys.platform != "win32":
def sigpending() -> Any: ...
def sigwait(__sigset: Iterable[int]) -> _SIGNUM: ...
if sys.platform != "darwin":
def sigtimedwait(sigset: Iterable[int], timeout: float) -> struct_siginfo | None: ...
def sigwaitinfo(sigset: Iterable[int]) -> struct_siginfo: ...

View File

@ -1,15 +1,27 @@
from typing import NamedTuple
from _typeshed import structseq
from typing import Any, Tuple
from typing_extensions import final
class struct_spwd(NamedTuple):
sp_namp: str
sp_pwdp: str
sp_lstchg: int
sp_min: int
sp_max: int
sp_warn: int
sp_inact: int
sp_expire: int
sp_flag: int
@final
class struct_spwd(structseq[Any], Tuple[str, str, int, int, int, int, int, int, int]):
@property
def sp_namp(self) -> str: ...
@property
def sp_pwdp(self) -> str: ...
@property
def sp_lstchg(self) -> int: ...
@property
def sp_min(self) -> int: ...
@property
def sp_max(self) -> int: ...
@property
def sp_warn(self) -> int: ...
@property
def sp_inact(self) -> int: ...
@property
def sp_expire(self) -> int: ...
@property
def sp_flag(self) -> int: ...
def getspall() -> list[struct_spwd]: ...
def getspnam(__arg: str) -> struct_spwd: ...

View File

@ -24,7 +24,7 @@ class _State:
def __init__(self) -> None: ...
@property
def groups(self) -> int: ...
def opengroup(self, name: str = ...) -> int: ...
def opengroup(self, name: str | None = ...) -> int: ...
def closegroup(self, gid: int, p: SubPattern) -> None: ...
def checkgroup(self, gid: int) -> bool: ...
def checklookbehindgroup(self, gid: int, source: Tokenizer) -> None: ...

View File

@ -1,5 +1,5 @@
import sys
from _typeshed import SupportsLessThanT
from _typeshed import SupportsRichComparisonT
from decimal import Decimal
from fractions import Fraction
from typing import Any, Hashable, Iterable, NamedTuple, Sequence, SupportsFloat, Type, TypeVar, Union
@ -27,8 +27,8 @@ else:
def harmonic_mean(data: Iterable[_NumberT]) -> _NumberT: ...
def median(data: Iterable[_NumberT]) -> _NumberT: ...
def median_low(data: Iterable[SupportsLessThanT]) -> SupportsLessThanT: ...
def median_high(data: Iterable[SupportsLessThanT]) -> SupportsLessThanT: ...
def median_low(data: Iterable[SupportsRichComparisonT]) -> SupportsRichComparisonT: ...
def median_high(data: Iterable[SupportsRichComparisonT]) -> SupportsRichComparisonT: ...
def median_grouped(data: Iterable[_NumberT], interval: _NumberT = ...) -> _NumberT: ...
def mode(data: Iterable[_HashableT]) -> _HashableT: ...

View File

@ -11,8 +11,9 @@ _T = TypeVar("_T")
__all__: list[str]
def active_count() -> int: ...
def activeCount() -> int: ... # deprecated alias for active_count()
def current_thread() -> Thread: ...
def currentThread() -> Thread: ...
def currentThread() -> Thread: ... # deprecated alias for current_thread()
def get_ident() -> int: ...
def enumerate() -> list[Thread]: ...
def main_thread() -> Thread: ...
@ -55,14 +56,15 @@ class Thread:
def start(self) -> None: ...
def run(self) -> None: ...
def join(self, timeout: float | None = ...) -> None: ...
def getName(self) -> str: ...
def setName(self, name: str) -> None: ...
if sys.version_info >= (3, 8):
@property
def native_id(self) -> int | None: ... # only available on some platforms
def is_alive(self) -> bool: ...
if sys.version_info < (3, 9):
def isAlive(self) -> bool: ...
# the following methods are all deprecated
def getName(self) -> str: ...
def setName(self, name: str) -> None: ...
def isDaemon(self) -> bool: ...
def setDaemon(self, daemonic: bool) -> None: ...
@ -102,7 +104,7 @@ class Condition:
def wait_for(self, predicate: Callable[[], _T], timeout: float | None = ...) -> _T: ...
def notify(self, n: int = ...) -> None: ...
def notify_all(self) -> None: ...
def notifyAll(self) -> None: ...
def notifyAll(self) -> None: ... # deprecated alias for notify_all()
class Semaphore:
def __init__(self, value: int = ...) -> None: ...
@ -121,6 +123,7 @@ class BoundedSemaphore(Semaphore): ...
class Event:
def __init__(self) -> None: ...
def is_set(self) -> bool: ...
def isSet(self) -> bool: ... # deprecated alias for is_set()
def set(self) -> None: ...
def clear(self) -> None: ...
def wait(self, timeout: float | None = ...) -> bool: ...

View File

@ -1,6 +1,7 @@
import sys
from _typeshed import structseq
from types import SimpleNamespace
from typing import Any, NamedTuple, Tuple
from typing import Any, Tuple, Union
from typing_extensions import final
_TimeTuple = Tuple[int, int, int, int, int, int, int, int, int]
@ -32,39 +33,31 @@ if sys.version_info >= (3, 8) and sys.platform == "darwin":
if sys.version_info >= (3, 9) and sys.platform == "linux":
CLOCK_TAI: int
class _struct_time(NamedTuple):
tm_year: int
tm_mon: int
tm_mday: int
tm_hour: int
tm_min: int
tm_sec: int
tm_wday: int
tm_yday: int
tm_isdst: int
@property
def n_fields(self) -> int: ...
@property
def n_sequence_fields(self) -> int: ...
@property
def n_unnamed_fields(self) -> int: ...
# Constructor takes an iterable of any type, of length between 9 and 11 elements.
# However, it always *behaves* like a tuple of 9 elements,
# even if an iterable with length >9 is passed.
# https://github.com/python/typeshed/pull/6560#discussion_r767162532
@final
class struct_time(_struct_time):
def __init__(
self,
o: tuple[int, int, int, int, int, int, int, int, int]
| tuple[int, int, int, int, int, int, int, int, int, str]
| tuple[int, int, int, int, int, int, int, int, int, str, int],
_arg: Any = ...,
) -> None: ...
def __new__(
cls,
o: tuple[int, int, int, int, int, int, int, int, int]
| tuple[int, int, int, int, int, int, int, int, int, str]
| tuple[int, int, int, int, int, int, int, int, int, str, int],
_arg: Any = ...,
) -> struct_time: ...
class struct_time(structseq[Union[Any, int]], _TimeTuple):
@property
def tm_year(self) -> int: ...
@property
def tm_mon(self) -> int: ...
@property
def tm_mday(self) -> int: ...
@property
def tm_hour(self) -> int: ...
@property
def tm_min(self) -> int: ...
@property
def tm_sec(self) -> int: ...
@property
def tm_wday(self) -> int: ...
@property
def tm_yday(self) -> int: ...
@property
def tm_isdst(self) -> int: ...
# These final two properties only exist if a 10- or 11-item sequence was passed to the constructor.
@property
def tm_zone(self) -> str: ...
@property

View File

@ -111,6 +111,7 @@ _TakeFocusValue = Union[int, Literal[""], Callable[[str], Optional[bool]]] # -t
class EventType(str, Enum):
Activate: str
ButtonPress: str
Button = ButtonPress
ButtonRelease: str
Circulate: str
CirculateRequest: str
@ -128,6 +129,7 @@ class EventType(str, Enum):
GraphicsExpose: str
Gravity: str
KeyPress: str
Key = KeyPress
KeyRelease: str
Keymap: str
Leave: str
@ -740,14 +742,6 @@ class Pack:
pack = pack_configure
forget = pack_forget
propagate = Misc.pack_propagate
# commented out to avoid mypy getting confused with multiple
# inheritance and how things get overridden with different things
# info = pack_info
# pack_propagate = Misc.pack_propagate
# configure = pack_configure
# config = pack_configure
# slaves = Misc.pack_slaves
# pack_slaves = Misc.pack_slaves
class _PlaceInfo(_InMiscNonTotal): # empty dict if widget hasn't been placed
anchor: _Anchor
@ -784,13 +778,6 @@ class Place:
def place_info(self) -> _PlaceInfo: ...
place = place_configure
info = place_info
# commented out to avoid mypy getting confused with multiple
# inheritance and how things get overridden with different things
# config = place_configure
# configure = place_configure
# forget = place_forget
# slaves = Misc.place_slaves
# place_slaves = Misc.place_slaves
class _GridInfo(_InMiscNonTotal): # empty dict if widget hasn't been gridded
column: int
@ -826,24 +813,6 @@ class Grid:
grid = grid_configure
location = Misc.grid_location
size = Misc.grid_size
# commented out to avoid mypy getting confused with multiple
# inheritance and how things get overridden with different things
# bbox = Misc.grid_bbox
# grid_bbox = Misc.grid_bbox
# forget = grid_forget
# info = grid_info
# grid_location = Misc.grid_location
# grid_propagate = Misc.grid_propagate
# grid_size = Misc.grid_size
# rowconfigure = Misc.grid_rowconfigure
# grid_rowconfigure = Misc.grid_rowconfigure
# grid_columnconfigure = Misc.grid_columnconfigure
# columnconfigure = Misc.grid_columnconfigure
# config = grid_configure
# configure = grid_configure
# propagate = Misc.grid_propagate
# slaves = Misc.grid_slaves
# grid_slaves = Misc.grid_slaves
class BaseWidget(Misc):
master: Misc

View File

@ -1,21 +1,36 @@
import sys
from _typeshed import SupportsWrite
from types import FrameType, TracebackType
from typing import IO, Any, Generator, Iterable, Iterator, List, Mapping, Optional, Tuple, Type
from typing import IO, Any, Generator, Iterable, Iterator, List, Mapping, Optional, Tuple, Type, overload
_PT = Tuple[str, int, str, Optional[str]]
def print_tb(tb: TracebackType | None, limit: int | None = ..., file: IO[str] | None = ...) -> None: ...
if sys.version_info >= (3, 10):
@overload
def print_exception(
__exc: Type[BaseException] | BaseException | None,
__exc: Type[BaseException] | None,
value: BaseException | None = ...,
tb: TracebackType | None = ...,
limit: int | None = ...,
file: IO[str] | None = ...,
chain: bool = ...,
) -> None: ...
@overload
def print_exception(
__exc: BaseException, *, limit: int | None = ..., file: IO[str] | None = ..., chain: bool = ...
) -> None: ...
@overload
def format_exception(
__exc: Type[BaseException] | None,
value: BaseException | None = ...,
tb: TracebackType | None = ...,
limit: int | None = ...,
chain: bool = ...,
) -> list[str]: ...
@overload
def format_exception(__exc: BaseException, *, limit: int | None = ..., chain: bool = ...) -> list[str]: ...
else:
def print_exception(
@ -26,6 +41,13 @@ else:
file: IO[str] | None = ...,
chain: bool = ...,
) -> None: ...
def format_exception(
etype: Type[BaseException] | None,
value: BaseException | None,
tb: TracebackType | None,
limit: int | None = ...,
chain: bool = ...,
) -> list[str]: ...
def print_exc(limit: int | None = ..., file: IO[str] | None = ..., chain: bool = ...) -> None: ...
def print_last(limit: int | None = ..., file: IO[str] | None = ..., chain: bool = ...) -> None: ...
@ -43,24 +65,6 @@ if sys.version_info >= (3, 10):
else:
def format_exception_only(etype: Type[BaseException] | None, value: BaseException | None) -> list[str]: ...
if sys.version_info >= (3, 10):
def format_exception(
__exc: Type[BaseException] | None,
value: BaseException | None = ...,
tb: TracebackType | None = ...,
limit: int | None = ...,
chain: bool = ...,
) -> list[str]: ...
else:
def format_exception(
etype: Type[BaseException] | None,
value: BaseException | None,
tb: TracebackType | None,
limit: int | None = ...,
chain: bool = ...,
) -> list[str]: ...
def format_exc(limit: int | None = ..., chain: bool = ...) -> str: ...
def format_tb(tb: TracebackType | None, limit: int | None = ...) -> list[str]: ...
def format_stack(f: FrameType | None = ..., limit: int | None = ...) -> list[str]: ...

View File

@ -1,5 +1,5 @@
from tkinter import Canvas, PhotoImage
from typing import Any, Callable, Dict, Sequence, Tuple, TypeVar, Union, overload
from tkinter import Canvas, Frame, PhotoImage
from typing import Any, Callable, ClassVar, Dict, Sequence, Tuple, TypeVar, Union, overload
# Note: '_Color' is the alias we use for arguments and _AnyColor is the
# alias we use for return types. Really, these two aliases should be the
@ -18,6 +18,8 @@ _PolygonCoords = Sequence[Tuple[float, float]]
# Vec2D is actually a custom subclass of 'tuple'.
Vec2D = Tuple[float, float]
class ScrolledCanvas(Frame): ...
class TurtleScreenBase(object):
cv: Canvas
canvwidth: int
@ -206,6 +208,8 @@ class TPen(object):
_T = TypeVar("_T")
class RawTurtle(TPen, TNavigator):
screen: TurtleScreen
screens: ClassVar[list[TurtleScreen]]
def __init__(
self, canvas: Canvas | TurtleScreen | None = ..., shape: str = ..., undobuffersize: int = ..., visible: bool = ...
) -> None: ...

View File

@ -1,4 +1,5 @@
import sys
from _typeshed import SupportsKeysAndGetItem
from importlib.abc import _LoaderProtocol
from importlib.machinery import ModuleSpec
from typing import (
@ -173,7 +174,7 @@ class CodeType:
@final
class MappingProxyType(Mapping[_KT, _VT_co], Generic[_KT, _VT_co]):
__hash__: None # type: ignore[assignment]
def __init__(self, mapping: Mapping[_KT, _VT_co]) -> None: ...
def __init__(self, mapping: SupportsKeysAndGetItem[_KT, _VT_co]) -> None: ...
def __getitem__(self, k: _KT) -> _VT_co: ...
def __iter__(self) -> Iterator[_KT]: ...
def __len__(self) -> int: ...

View File

@ -10,9 +10,6 @@ if sys.version_info >= (3, 7):
if sys.version_info >= (3, 9):
from types import GenericAlias
# Definitions of special type checking related constructs. Their definitions
# are not used, so their value does not matter.
Any = object()
class TypeVar:
@ -29,11 +26,18 @@ class TypeVar:
covariant: bool = ...,
contravariant: bool = ...,
) -> None: ...
if sys.version_info >= (3, 10):
def __or__(self, other: Any) -> _SpecialForm: ...
def __ror__(self, other: Any) -> _SpecialForm: ...
# Used for an undocumented mypy feature. Does not exist at runtime.
_promote = object()
class _SpecialForm:
def __getitem__(self, typeargs: Any) -> object: ...
if sys.version_info >= (3, 10):
def __or__(self, other: Any) -> _SpecialForm: ...
def __ror__(self, other: Any) -> _SpecialForm: ...
_F = TypeVar("_F", bound=Callable[..., Any])
_P = _ParamSpec("_P")
@ -80,6 +84,8 @@ if sys.version_info >= (3, 10):
def args(self) -> ParamSpecArgs: ...
@property
def kwargs(self) -> ParamSpecKwargs: ...
def __or__(self, other: Any) -> _SpecialForm: ...
def __ror__(self, other: Any) -> _SpecialForm: ...
Concatenate: _SpecialForm = ...
TypeAlias: _SpecialForm = ...
TypeGuard: _SpecialForm = ...
@ -263,7 +269,7 @@ class Coroutine(Awaitable[_V_co], Generic[_T_co, _T_contra, _V_co]):
@abstractmethod
def close(self) -> None: ...
# NOTE: This type does not exist in typing.py or PEP 484.
# NOTE: This type does not exist in typing.py or PEP 484 but mypy needs it to exist.
# The parameters correspond to Generator, but the 4th is the original type.
class AwaitableGenerator(
Awaitable[_V_co], Generator[_T_co, _T_contra, _V_co], Generic[_T_co, _T_contra, _V_co, _S], metaclass=ABCMeta
@ -674,7 +680,6 @@ def cast(typ: object, val: Any) -> Any: ...
# Type constructors
# NamedTuple is special-cased in the type checker
class NamedTuple(Tuple[Any, ...]):
_field_types: collections.OrderedDict[str, Type[Any]]
_field_defaults: dict[str, Any]
@ -719,14 +724,17 @@ if sys.version_info >= (3, 7):
__forward_value__: Any | None
__forward_is_argument__: bool
if sys.version_info >= (3, 9):
# The module argument was added in Python 3.9.7.
def __init__(self, arg: str, is_argument: bool = ..., module: Any | None = ...) -> None: ...
# The module and is_class arguments were added in later Python 3.9 versions.
def __init__(self, arg: str, is_argument: bool = ..., module: Any | None = ..., *, is_class: bool = ...) -> None: ...
else:
def __init__(self, arg: str, is_argument: bool = ...) -> None: ...
def _evaluate(self, globalns: dict[str, Any] | None, localns: dict[str, Any] | None) -> Any | None: ...
def __eq__(self, other: Any) -> bool: ...
def __hash__(self) -> int: ...
def __repr__(self) -> str: ...
if sys.version_info >= (3, 11):
def __or__(self, other: Any) -> _SpecialForm: ...
def __ror__(self, other: Any) -> _SpecialForm: ...
if sys.version_info >= (3, 10):
def is_typeddict(tp: Any) -> bool: ...
def is_typeddict(tp: object) -> bool: ...

View File

@ -10,10 +10,12 @@ from typing import (
Any,
AnyStr,
Callable,
ClassVar,
Container,
Generic,
Iterable,
Mapping,
NamedTuple,
NoReturn,
Pattern,
Sequence,
@ -22,7 +24,6 @@ from typing import (
TypeVar,
overload,
)
from unittest._log import _AssertLogsContext, _LoggingWatcher
from warnings import WarningMessage
if sys.version_info >= (3, 9):
@ -31,6 +32,31 @@ if sys.version_info >= (3, 9):
_E = TypeVar("_E", bound=BaseException)
_FT = TypeVar("_FT", bound=Callable[..., Any])
class _BaseTestCaseContext:
def __init__(self, test_case: TestCase) -> None: ...
if sys.version_info >= (3, 9):
from unittest._log import _AssertLogsContext, _LoggingWatcher
else:
# Unused dummy for _AssertLogsContext. Starting with Python 3.10,
# this is generic over the logging watcher, but in lower versions
# the watcher is hard-coded.
_L = TypeVar("_L")
class _LoggingWatcher(NamedTuple):
records: list[logging.LogRecord]
output: list[str]
class _AssertLogsContext(_BaseTestCaseContext, Generic[_L]):
LOGGING_FORMAT: ClassVar[str]
test_case: TestCase
logger_name: str
level: int
msg: None
def __init__(self, test_case: TestCase, logger_name: str, level: int) -> None: ...
def __enter__(self) -> _LoggingWatcher: ...
def __exit__(
self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> bool | None: ...
if sys.version_info >= (3, 8):
def addModuleCleanup(__function: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ...
def doModuleCleanups() -> None: ...

View File

@ -116,10 +116,10 @@ def urldefrag(url: bytes | None) -> DefragResultBytes: ...
def urlencode(
query: Mapping[Any, Any] | Mapping[Any, Sequence[Any]] | Sequence[tuple[Any, Any]] | Sequence[tuple[Any, Sequence[Any]]],
doseq: bool = ...,
safe: AnyStr = ...,
safe: _Str = ...,
encoding: str = ...,
errors: str = ...,
quote_via: Callable[[str, AnyStr, str, str], str] = ...,
quote_via: Callable[[AnyStr, _Str, str, str], str] = ...,
) -> str: ...
def urljoin(base: AnyStr, url: AnyStr | None, allow_fragments: bool = ...) -> AnyStr: ...
@overload

View File

@ -43,6 +43,7 @@ class IndexSizeErr(DOMException): ...
class DomstringSizeErr(DOMException): ...
class HierarchyRequestErr(DOMException): ...
class WrongDocumentErr(DOMException): ...
class InvalidCharacterErr(DOMException): ...
class NoDataAllowedErr(DOMException): ...
class NoModificationAllowedErr(DOMException): ...
class NotFoundErr(DOMException): ...

View File

@ -1,3 +1,99 @@
from typing import Any
from typing import Any, NoReturn
from xml.dom.minidom import Document, DOMImplementation, Node, TypeInfo
from xml.dom.xmlbuilder import DOMBuilderFilter, Options
def __getattr__(name: str) -> Any: ... # incomplete
TEXT_NODE = Node.TEXT_NODE
CDATA_SECTION_NODE = Node.CDATA_SECTION_NODE
DOCUMENT_NODE = Node.DOCUMENT_NODE
FILTER_ACCEPT = DOMBuilderFilter.FILTER_ACCEPT
FILTER_REJECT = DOMBuilderFilter.FILTER_REJECT
FILTER_SKIP = DOMBuilderFilter.FILTER_SKIP
FILTER_INTERRUPT = DOMBuilderFilter.FILTER_INTERRUPT
theDOMImplementation: DOMImplementation | None
class ElementInfo:
tagName: Any
def __init__(self, tagName, model: Any | None = ...) -> None: ...
def getAttributeType(self, aname) -> TypeInfo: ...
def getAttributeTypeNS(self, namespaceURI, localName) -> TypeInfo: ...
def isElementContent(self) -> bool: ...
def isEmpty(self) -> bool: ...
def isId(self, aname) -> bool: ...
def isIdNS(self, euri, ename, auri, aname) -> bool: ...
class ExpatBuilder:
document: Document # Created in self.reset()
curNode: Any # Created in self.reset()
def __init__(self, options: Options | None = ...) -> None: ...
def createParser(self): ...
def getParser(self): ...
def reset(self) -> None: ...
def install(self, parser) -> None: ...
def parseFile(self, file) -> Document: ...
def parseString(self, string: str) -> Document: ...
def start_doctype_decl_handler(self, doctypeName, systemId, publicId, has_internal_subset) -> None: ...
def end_doctype_decl_handler(self) -> None: ...
def pi_handler(self, target, data) -> None: ...
def character_data_handler_cdata(self, data) -> None: ...
def character_data_handler(self, data) -> None: ...
def start_cdata_section_handler(self) -> None: ...
def end_cdata_section_handler(self) -> None: ...
def entity_decl_handler(self, entityName, is_parameter_entity, value, base, systemId, publicId, notationName) -> None: ...
def notation_decl_handler(self, notationName, base, systemId, publicId) -> None: ...
def comment_handler(self, data) -> None: ...
def external_entity_ref_handler(self, context, base, systemId, publicId) -> int: ...
def first_element_handler(self, name, attributes) -> None: ...
def start_element_handler(self, name, attributes) -> None: ...
def end_element_handler(self, name) -> None: ...
def element_decl_handler(self, name, model) -> None: ...
def attlist_decl_handler(self, elem, name, type, default, required) -> None: ...
def xml_decl_handler(self, version, encoding, standalone) -> None: ...
class FilterVisibilityController:
filter: DOMBuilderFilter
def __init__(self, filter: DOMBuilderFilter) -> None: ...
def startContainer(self, node: Node) -> int: ...
def acceptNode(self, node: Node) -> int: ...
class FilterCrutch:
def __init__(self, builder) -> None: ...
class Rejecter(FilterCrutch):
def start_element_handler(self, *args: Any) -> None: ...
def end_element_handler(self, *args: Any) -> None: ...
class Skipper(FilterCrutch):
def start_element_handler(self, *args: Any) -> None: ...
def end_element_handler(self, *args: Any) -> None: ...
class FragmentBuilder(ExpatBuilder):
fragment: Any | None
originalDocument: Any
context: Any
def __init__(self, context, options: Options | None = ...) -> None: ...
class Namespaces:
def createParser(self): ...
def install(self, parser) -> None: ...
def start_namespace_decl_handler(self, prefix, uri) -> None: ...
def start_element_handler(self, name, attributes) -> None: ...
def end_element_handler(self, name) -> None: ...
class ExpatBuilderNS(Namespaces, ExpatBuilder): ...
class FragmentBuilderNS(Namespaces, FragmentBuilder): ...
class ParseEscape(Exception): ...
class InternalSubsetExtractor(ExpatBuilder):
subset: Any | None
def getSubset(self) -> Any | None: ...
def parseFile(self, file) -> None: ... # type: ignore[override]
def parseString(self, string: str) -> None: ... # type: ignore[override]
def start_doctype_decl_handler(self, name, publicId, systemId, has_internal_subset) -> None: ... # type: ignore[override]
def end_doctype_decl_handler(self) -> NoReturn: ...
def start_element_handler(self, name, attrs) -> NoReturn: ...
def parse(file, namespaces: bool = ...): ...
def parseString(string: str, namespaces: bool = ...): ...
def parseFragment(file, context, namespaces: bool = ...): ...
def parseFragmentString(string: str, context, namespaces: bool = ...): ...
def makeBuilder(options: Options) -> ExpatBuilderNS | ExpatBuilder: ...

View File

@ -70,6 +70,10 @@ class Attr(Node):
self, qName: str, namespaceURI: str | None = ..., localName: Any | None = ..., prefix: Any | None = ...
) -> None: ...
def unlink(self) -> None: ...
@property
def isId(self) -> bool: ...
@property
def schemaType(self) -> Any: ...
class NamedNodeMap:
def __init__(self, attrs, attrsNS, ownerElement) -> None: ...
@ -96,6 +100,8 @@ class NamedNodeMap:
def setNamedItem(self, node): ...
def setNamedItemNS(self, node): ...
def __delitem__(self, attname_or_tuple) -> None: ...
@property
def length(self) -> int: ...
AttributeList = NamedNodeMap
@ -110,6 +116,7 @@ class Element(Node):
schemaType: Any
parentNode: Any
tagName: str
nodeName: str
prefix: Any
namespaceURI: str | None
childNodes: Any
@ -139,6 +146,8 @@ class Element(Node):
def setIdAttribute(self, name) -> None: ...
def setIdAttributeNS(self, namespaceURI: str, localName) -> None: ...
def setIdAttributeNode(self, idAttr) -> None: ...
@property
def attributes(self) -> NamedNodeMap: ...
class Childless:
attributes: Any
@ -173,6 +182,8 @@ class CharacterData(Childless, Node):
def insertData(self, offset: int, arg: str) -> None: ...
def deleteData(self, offset: int, count: int) -> None: ...
def replaceData(self, offset: int, count: int, arg: str) -> None: ...
@property
def length(self) -> int: ...
class Text(CharacterData):
nodeType: Any
@ -182,6 +193,10 @@ class Text(CharacterData):
def splitText(self, offset): ...
def writexml(self, writer, indent: str = ..., addindent: str = ..., newl: str = ...) -> None: ...
def replaceWholeText(self, content): ...
@property
def isWhitespaceInElementContent(self) -> bool: ...
@property
def wholeText(self) -> str: ...
class Comment(CharacterData):
nodeType: Any
@ -205,15 +220,17 @@ class ReadOnlySequentialNamedNodeMap:
def removeNamedItemNS(self, namespaceURI: str, localName) -> None: ...
def setNamedItem(self, node) -> None: ...
def setNamedItemNS(self, node) -> None: ...
@property
def length(self) -> int: ...
class Identified: ...
class Identified:
publicId: Any
systemId: Any
class DocumentType(Identified, Childless, Node):
nodeType: Any
nodeValue: Any
name: Any
publicId: Any
systemId: Any
internalSubset: Any
entities: Any
notations: Any

View File

@ -17,6 +17,7 @@ if sys.version_info >= (3, 9):
def include(
elem: Element, loader: Callable[..., str | Element] | None = ..., base_url: str | None = ..., max_depth: int | None = ...
) -> None: ...
class LimitedRecursiveIncludeError(FatalIncludeError): ...
else:
def include(elem: Element, loader: Callable[..., str | Element] | None = ...) -> None: ...

View File

@ -10,6 +10,7 @@ from typing import (
Iterable,
Iterator,
KeysView,
Mapping,
MutableSequence,
Sequence,
TypeVar,
@ -259,11 +260,29 @@ def fromstringlist(sequence: Sequence[str | bytes], parser: XMLParser | None = .
_ElementFactory = Callable[[Any, Dict[Any, Any]], Element]
class TreeBuilder:
if sys.version_info >= (3, 8):
# comment_factory can take None because passing None to Comment is not an error
def __init__(
self,
element_factory: _ElementFactory | None = ...,
*,
comment_factory: Callable[[str | None], Element] | None = ...,
pi_factory: Callable[[str, str | None], Element] | None = ...,
insert_comments: bool = ...,
insert_pis: bool = ...,
) -> None: ...
insert_comments: bool
insert_pis: bool
else:
def __init__(self, element_factory: _ElementFactory | None = ...) -> None: ...
def close(self) -> Element: ...
def data(self, __data: str | bytes) -> None: ...
def start(self, __tag: str | bytes, __attrs: dict[str | bytes, str | bytes]) -> Element: ...
def end(self, __tag: str | bytes) -> Element: ...
if sys.version_info >= (3, 8):
# These two methods have pos-only parameters in the C implementation
def comment(self, __text: str | None) -> Element: ...
def pi(self, __target: str, __text: str | None = ...) -> Element: ...
if sys.version_info >= (3, 8):
class C14NWriterTarget:
@ -279,6 +298,12 @@ if sys.version_info >= (3, 8):
exclude_attrs: Iterable[str] | None = ...,
exclude_tags: Iterable[str] | None = ...,
) -> None: ...
def data(self, data: str) -> None: ...
def start_ns(self, prefix: str, uri: str) -> None: ...
def start(self, tag: str, attrs: Mapping[str, str]) -> None: ...
def end(self, tag: str) -> None: ...
def comment(self, text: str) -> None: ...
def pi(self, target: str, data: str) -> None: ...
class XMLParser:
parser: Any

View File

@ -1,6 +1,9 @@
from typing import Any, Iterable, Protocol
from typing import Any, Iterable, Protocol, Union
from .Image import Image, _Resample, _Size
from .ImageColor import _Ink
_Border = Union[int, tuple[int, int], tuple[int, int, int, int]]
class _Deformer(Protocol):
def getmesh(self, image: Image): ...
@ -21,11 +24,11 @@ def contain(image: Image, size: _Size, method: _Resample = ...) -> Image: ...
def pad(
image: Image, size: _Size, method: _Resample = ..., color: Any | None = ..., centering: Iterable[float] = ...
) -> Image: ...
def crop(image: Image, border: int = ...) -> Image: ...
def crop(image: Image, border: _Border = ...) -> Image: ...
def scale(image: Image, factor: float, resample: _Resample = ...) -> Image: ...
def deform(image: Image, deformer: _Deformer, resample: _Resample = ...) -> Image: ...
def equalize(image: Image, mask: Any | None = ...) -> Image: ...
def expand(image: Image, border: int = ..., fill: int = ...) -> Image: ...
def expand(image: Image, border: _Border = ..., fill: _Ink = ...) -> Image: ...
def fit(image: Image, size: _Size, method: _Resample = ..., bleed: float = ..., centering: Iterable[float] = ...) -> Image: ...
def flip(image: Image) -> Image: ...
def grayscale(image: Image) -> Image: ...

View File

@ -1,3 +1,6 @@
from typing import Generator, Type
from ..formatter import Formatter
from .bbcode import BBCodeFormatter as BBCodeFormatter
from .html import HtmlFormatter as HtmlFormatter
from .img import (
@ -15,7 +18,7 @@ from .svg import SvgFormatter as SvgFormatter
from .terminal import TerminalFormatter as TerminalFormatter
from .terminal256 import Terminal256Formatter as Terminal256Formatter, TerminalTrueColorFormatter as TerminalTrueColorFormatter
def get_all_formatters() -> None: ...
def get_all_formatters() -> Generator[Type[Formatter], None, None]: ...
def get_formatter_by_name(_alias, **options): ...
def load_formatter_from_file(filename, formattername: str = ..., **options): ...
def get_formatter_for_filename(fn, **options): ...

View File

@ -0,0 +1,5 @@
version = "1.4.*"
extra_description = """\
The `sqlalchemy-stubs` package is an alternative to this package and also \
includes a mypy plugin for more precise types.\
"""

View File

@ -0,0 +1,133 @@
from .engine import (
create_engine as create_engine,
create_mock_engine as create_mock_engine,
engine_from_config as engine_from_config,
)
from .inspection import inspect as inspect
from .schema import (
BLANK_SCHEMA as BLANK_SCHEMA,
DDL as DDL,
CheckConstraint as CheckConstraint,
Column as Column,
ColumnDefault as ColumnDefault,
Computed as Computed,
Constraint as Constraint,
DefaultClause as DefaultClause,
FetchedValue as FetchedValue,
ForeignKey as ForeignKey,
ForeignKeyConstraint as ForeignKeyConstraint,
Identity as Identity,
Index as Index,
MetaData as MetaData,
PrimaryKeyConstraint as PrimaryKeyConstraint,
Sequence as Sequence,
Table as Table,
ThreadLocalMetaData as ThreadLocalMetaData,
UniqueConstraint as UniqueConstraint,
)
from .sql import (
LABEL_STYLE_DEFAULT as LABEL_STYLE_DEFAULT,
LABEL_STYLE_DISAMBIGUATE_ONLY as LABEL_STYLE_DISAMBIGUATE_ONLY,
LABEL_STYLE_NONE as LABEL_STYLE_NONE,
LABEL_STYLE_TABLENAME_PLUS_COL as LABEL_STYLE_TABLENAME_PLUS_COL,
alias as alias,
all_ as all_,
and_ as and_,
any_ as any_,
asc as asc,
between as between,
bindparam as bindparam,
case as case,
cast as cast,
collate as collate,
column as column,
delete as delete,
desc as desc,
distinct as distinct,
except_ as except_,
except_all as except_all,
exists as exists,
extract as extract,
false as false,
func as func,
funcfilter as funcfilter,
insert as insert,
intersect as intersect,
intersect_all as intersect_all,
join as join,
lambda_stmt as lambda_stmt,
lateral as lateral,
literal as literal,
literal_column as literal_column,
modifier as modifier,
not_ as not_,
null as null,
nulls_first as nulls_first,
nulls_last as nulls_last,
nullsfirst as nullsfirst,
nullslast as nullslast,
or_ as or_,
outerjoin as outerjoin,
outparam as outparam,
over as over,
select as select,
subquery as subquery,
table as table,
tablesample as tablesample,
text as text,
true as true,
tuple_ as tuple_,
type_coerce as type_coerce,
union as union,
union_all as union_all,
update as update,
values as values,
within_group as within_group,
)
from .types import (
ARRAY as ARRAY,
BIGINT as BIGINT,
BINARY as BINARY,
BLOB as BLOB,
BOOLEAN as BOOLEAN,
CHAR as CHAR,
CLOB as CLOB,
DATE as DATE,
DATETIME as DATETIME,
DECIMAL as DECIMAL,
FLOAT as FLOAT,
INT as INT,
INTEGER as INTEGER,
JSON as JSON,
NCHAR as NCHAR,
NUMERIC as NUMERIC,
NVARCHAR as NVARCHAR,
REAL as REAL,
SMALLINT as SMALLINT,
TEXT as TEXT,
TIME as TIME,
TIMESTAMP as TIMESTAMP,
VARBINARY as VARBINARY,
VARCHAR as VARCHAR,
BigInteger as BigInteger,
Boolean as Boolean,
Date as Date,
DateTime as DateTime,
Enum as Enum,
Float as Float,
Integer as Integer,
Interval as Interval,
LargeBinary as LargeBinary,
Numeric as Numeric,
PickleType as PickleType,
SmallInteger as SmallInteger,
String as String,
Text as Text,
Time as Time,
TupleType as TupleType,
TypeDecorator as TypeDecorator,
Unicode as Unicode,
UnicodeText as UnicodeText,
)
__version__: str

View File

@ -0,0 +1,12 @@
class immutabledict:
def __len__(self) -> int: ...
def __getitem__(self, __item): ...
def __iter__(self): ...
def union(self, **kwargs): ...
def merge_with(self, *args): ...
def keys(self): ...
def __contains__(self, __item): ...
def items(self): ...
def values(self): ...
def get(self, __key, __default=...): ...
def __reduce__(self): ...

View File

@ -0,0 +1,17 @@
from typing import Any
from . import Connector
class MxODBCConnector(Connector):
driver: str
supports_sane_multi_rowcount: bool
supports_unicode_statements: bool
supports_unicode_binds: bool
supports_native_decimal: bool
@classmethod
def dbapi(cls): ...
def on_connect(self): ...
def create_connect_args(self, url): ...
def is_disconnect(self, e, connection, cursor): ...
def do_executemany(self, cursor, statement, parameters, context: Any | None = ...) -> None: ...
def do_execute(self, cursor, statement, parameters, context: Any | None = ...) -> None: ...

View File

@ -0,0 +1,21 @@
from typing import Any
from . import Connector
class PyODBCConnector(Connector):
driver: str
supports_sane_rowcount_returning: bool
supports_sane_multi_rowcount: bool
supports_unicode_statements: bool
supports_unicode_binds: bool
supports_native_decimal: bool
default_paramstyle: str
use_setinputsizes: bool
pyodbc_driver_name: Any
def __init__(self, supports_unicode_binds: Any | None = ..., use_setinputsizes: bool = ..., **kw) -> None: ...
@classmethod
def dbapi(cls): ...
def create_connect_args(self, url): ...
def is_disconnect(self, e, connection, cursor): ...
def do_set_input_sizes(self, cursor, list_of_tuples, context) -> None: ...
def set_isolation_level(self, connection, level) -> None: ...

View File

@ -0,0 +1,11 @@
from typing import Any
class BaseRow:
def __init__(self, parent, processors, keymap, key_style, data) -> None: ...
def __reduce__(self): ...
def __iter__(self): ...
def __len__(self): ...
def __hash__(self): ...
__getitem__: Any
def safe_rowproxy_reconstructor(__cls, __state): ...

View File

@ -0,0 +1,18 @@
from ..dialects.firebird import base as firebird_base
from ..dialects.mssql import base as mssql_base
from ..dialects.mysql import base as mysql_base
from ..dialects.oracle import base as oracle_base
from ..dialects.postgresql import base as postgresql_base
from ..dialects.sqlite import base as sqlite_base
from ..dialects.sybase import base as sybase_base
__all__ = ("firebird", "mssql", "mysql", "postgresql", "sqlite", "oracle", "sybase")
firebird = firebird_base
mssql = mssql_base
mysql = mysql_base
oracle = oracle_base
postgresql = postgresql_base
postgres = postgresql_base
sqlite = sqlite_base
sybase = sybase_base

View File

@ -0,0 +1,16 @@
from typing import Any
from . import (
firebird as firebird,
mssql as mssql,
mysql as mysql,
oracle as oracle,
postgresql as postgresql,
sqlite as sqlite,
sybase as sybase,
)
__all__ = ("firebird", "mssql", "mysql", "oracle", "postgresql", "sqlite", "sybase")
registry: Any
plugins: Any

View File

@ -0,0 +1,34 @@
from typing import Any
from sqlalchemy.dialects.firebird.base import (
BIGINT as BIGINT,
BLOB as BLOB,
CHAR as CHAR,
DATE as DATE,
FLOAT as FLOAT,
NUMERIC as NUMERIC,
SMALLINT as SMALLINT,
TEXT as TEXT,
TIME as TIME,
TIMESTAMP as TIMESTAMP,
VARCHAR as VARCHAR,
)
__all__ = (
"SMALLINT",
"BIGINT",
"FLOAT",
"FLOAT",
"DATE",
"TIME",
"TEXT",
"NUMERIC",
"FLOAT",
"TIMESTAMP",
"VARCHAR",
"CHAR",
"BLOB",
"dialect",
)
dialect: Any

View File

@ -0,0 +1,108 @@
from typing import Any
from sqlalchemy import sql, types as sqltypes
from sqlalchemy.engine import default
from sqlalchemy.sql import compiler
from sqlalchemy.types import (
BIGINT as BIGINT,
BLOB as BLOB,
DATE as DATE,
FLOAT as FLOAT,
INTEGER as INTEGER,
NUMERIC as NUMERIC,
SMALLINT as SMALLINT,
TEXT as TEXT,
TIME as TIME,
TIMESTAMP as TIMESTAMP,
Integer as Integer,
)
RESERVED_WORDS: Any
class _StringType(sqltypes.String):
charset: Any
def __init__(self, charset: Any | None = ..., **kw) -> None: ...
class VARCHAR(_StringType, sqltypes.VARCHAR):
__visit_name__: str
def __init__(self, length: Any | None = ..., **kwargs) -> None: ...
class CHAR(_StringType, sqltypes.CHAR):
__visit_name__: str
def __init__(self, length: Any | None = ..., **kwargs) -> None: ...
class _FBDateTime(sqltypes.DateTime):
def bind_processor(self, dialect): ...
colspecs: Any
ischema_names: Any
class FBTypeCompiler(compiler.GenericTypeCompiler):
def visit_boolean(self, type_, **kw): ...
def visit_datetime(self, type_, **kw): ...
def visit_TEXT(self, type_, **kw): ...
def visit_BLOB(self, type_, **kw): ...
def visit_CHAR(self, type_, **kw): ...
def visit_VARCHAR(self, type_, **kw): ...
class FBCompiler(sql.compiler.SQLCompiler):
ansi_bind_rules: bool
def visit_now_func(self, fn, **kw): ...
def visit_startswith_op_binary(self, binary, operator, **kw): ...
def visit_not_startswith_op_binary(self, binary, operator, **kw): ...
def visit_mod_binary(self, binary, operator, **kw): ...
def visit_alias(self, alias, asfrom: bool = ..., **kwargs): ... # type: ignore[override]
def visit_substring_func(self, func, **kw): ...
def visit_length_func(self, function, **kw): ...
visit_char_length_func: Any
def function_argspec(self, func, **kw): ...
def default_from(self): ...
def visit_sequence(self, seq, **kw): ...
def get_select_precolumns(self, select, **kw): ...
def limit_clause(self, select, **kw): ...
def returning_clause(self, stmt, returning_cols): ...
class FBDDLCompiler(sql.compiler.DDLCompiler):
def visit_create_sequence(self, create): ...
def visit_drop_sequence(self, drop): ...
def visit_computed_column(self, generated): ...
class FBIdentifierPreparer(sql.compiler.IdentifierPreparer):
reserved_words: Any
illegal_initial_characters: Any
def __init__(self, dialect) -> None: ...
class FBExecutionContext(default.DefaultExecutionContext):
def fire_sequence(self, seq, type_): ...
class FBDialect(default.DefaultDialect):
name: str
supports_statement_cache: bool
max_identifier_length: int
supports_sequences: bool
sequences_optional: bool
supports_default_values: bool
postfetch_lastrowid: bool
supports_native_boolean: bool
requires_name_normalize: bool
supports_empty_insert: bool
statement_compiler: Any
ddl_compiler: Any
preparer: Any
type_compiler: Any
colspecs: Any
ischema_names: Any
construct_arguments: Any
def __init__(self, *args, **kwargs) -> None: ...
implicit_returning: Any
def initialize(self, connection) -> None: ...
def has_table(self, connection, table_name, schema: Any | None = ...): ... # type: ignore[override]
def has_sequence(self, connection, sequence_name, schema: Any | None = ...): ... # type: ignore[override]
def get_table_names(self, connection, schema: Any | None = ..., **kw): ...
def get_view_names(self, connection, schema: Any | None = ..., **kw): ...
def get_view_definition(self, connection, view_name, schema: Any | None = ..., **kw): ...
def get_pk_constraint(self, connection, table_name, schema: Any | None = ..., **kw): ...
def get_column_sequence(self, connection, table_name, column_name, schema: Any | None = ..., **kw): ...
def get_columns(self, connection, table_name, schema: Any | None = ..., **kw): ...
def get_foreign_keys(self, connection, table_name, schema: Any | None = ..., **kw): ...
def get_indexes(self, connection, table_name, schema: Any | None = ..., **kw): ...

View File

@ -0,0 +1,10 @@
from .kinterbasdb import FBDialect_kinterbasdb
class FBDialect_fdb(FBDialect_kinterbasdb):
supports_statement_cache: bool
def __init__(self, enable_rowcount: bool = ..., retaining: bool = ..., **kwargs) -> None: ...
@classmethod
def dbapi(cls): ...
def create_connect_args(self, url): ...
dialect = FBDialect_fdb

View File

@ -0,0 +1,38 @@
from typing import Any
from ...types import Float, Numeric
from .base import FBDialect, FBExecutionContext
class _kinterbasdb_numeric:
def bind_processor(self, dialect): ...
class _FBNumeric_kinterbasdb(_kinterbasdb_numeric, Numeric): ...
class _FBFloat_kinterbasdb(_kinterbasdb_numeric, Float): ...
class FBExecutionContext_kinterbasdb(FBExecutionContext):
@property
def rowcount(self): ...
class FBDialect_kinterbasdb(FBDialect):
driver: str
supports_statement_cache: bool
supports_sane_rowcount: bool
supports_sane_multi_rowcount: bool
supports_native_decimal: bool
colspecs: Any
enable_rowcount: Any
type_conv: Any
concurrency_level: Any
retaining: Any
def __init__(
self, type_conv: int = ..., concurrency_level: int = ..., enable_rowcount: bool = ..., retaining: bool = ..., **kwargs
) -> None: ...
@classmethod
def dbapi(cls): ...
def do_execute(self, cursor, statement, parameters, context: Any | None = ...) -> None: ...
def do_rollback(self, dbapi_connection) -> None: ...
def do_commit(self, dbapi_connection) -> None: ...
def create_connect_args(self, url): ...
def is_disconnect(self, e, connection, cursor): ...
dialect = FBDialect_kinterbasdb

View File

@ -0,0 +1,76 @@
from typing import Any
from .base import (
BIGINT as BIGINT,
BINARY as BINARY,
BIT as BIT,
CHAR as CHAR,
DATE as DATE,
DATETIME as DATETIME,
DATETIME2 as DATETIME2,
DATETIMEOFFSET as DATETIMEOFFSET,
DECIMAL as DECIMAL,
FLOAT as FLOAT,
IMAGE as IMAGE,
INTEGER as INTEGER,
JSON as JSON,
MONEY as MONEY,
NCHAR as NCHAR,
NTEXT as NTEXT,
NUMERIC as NUMERIC,
NVARCHAR as NVARCHAR,
REAL as REAL,
ROWVERSION as ROWVERSION,
SMALLDATETIME as SMALLDATETIME,
SMALLINT as SMALLINT,
SMALLMONEY as SMALLMONEY,
SQL_VARIANT as SQL_VARIANT,
TEXT as TEXT,
TIME as TIME,
TIMESTAMP as TIMESTAMP,
TINYINT as TINYINT,
UNIQUEIDENTIFIER as UNIQUEIDENTIFIER,
VARBINARY as VARBINARY,
VARCHAR as VARCHAR,
XML as XML,
try_cast as try_cast,
)
__all__ = (
"JSON",
"INTEGER",
"BIGINT",
"SMALLINT",
"TINYINT",
"VARCHAR",
"NVARCHAR",
"CHAR",
"NCHAR",
"TEXT",
"NTEXT",
"DECIMAL",
"NUMERIC",
"FLOAT",
"DATETIME",
"DATETIME2",
"DATETIMEOFFSET",
"DATE",
"TIME",
"SMALLDATETIME",
"BINARY",
"VARBINARY",
"BIT",
"REAL",
"IMAGE",
"TIMESTAMP",
"ROWVERSION",
"MONEY",
"SMALLMONEY",
"UNIQUEIDENTIFIER",
"SQL_VARIANT",
"XML",
"dialect",
"try_cast",
)
dialect: Any

View File

@ -0,0 +1,316 @@
from typing import Any
import sqlalchemy.types as sqltypes
from ...engine import default
from ...sql import compiler
from ...sql.elements import Cast
from ...types import (
BIGINT as BIGINT,
BINARY as BINARY,
CHAR as CHAR,
DATE as DATE,
DATETIME as DATETIME,
DECIMAL as DECIMAL,
FLOAT as FLOAT,
INTEGER as INTEGER,
NCHAR as NCHAR,
NUMERIC as NUMERIC,
NVARCHAR as NVARCHAR,
SMALLINT as SMALLINT,
TEXT as TEXT,
VARCHAR as VARCHAR,
)
from .json import JSON as JSON
MS_2017_VERSION: Any
MS_2016_VERSION: Any
MS_2014_VERSION: Any
MS_2012_VERSION: Any
MS_2008_VERSION: Any
MS_2005_VERSION: Any
MS_2000_VERSION: Any
RESERVED_WORDS: Any
class REAL(sqltypes.REAL):
__visit_name__: str
def __init__(self, **kw) -> None: ...
class TINYINT(sqltypes.Integer):
__visit_name__: str
class _MSDate(sqltypes.Date):
def bind_processor(self, dialect): ...
def result_processor(self, dialect, coltype): ...
class TIME(sqltypes.TIME):
precision: Any
def __init__(self, precision: Any | None = ..., **kwargs) -> None: ...
def bind_processor(self, dialect): ...
def result_processor(self, dialect, coltype): ...
_MSTime = TIME
class _BASETIMEIMPL(TIME):
__visit_name__: str
class _DateTimeBase:
def bind_processor(self, dialect): ...
class _MSDateTime(_DateTimeBase, sqltypes.DateTime): ...
class SMALLDATETIME(_DateTimeBase, sqltypes.DateTime):
__visit_name__: str
class DATETIME2(_DateTimeBase, sqltypes.DateTime):
__visit_name__: str
precision: Any
def __init__(self, precision: Any | None = ..., **kw) -> None: ...
class DATETIMEOFFSET(_DateTimeBase, sqltypes.DateTime):
__visit_name__: str
precision: Any
def __init__(self, precision: Any | None = ..., **kw) -> None: ...
class _UnicodeLiteral:
def literal_processor(self, dialect): ...
class _MSUnicode(_UnicodeLiteral, sqltypes.Unicode): ...
class _MSUnicodeText(_UnicodeLiteral, sqltypes.UnicodeText): ...
class TIMESTAMP(sqltypes._Binary):
__visit_name__: str
length: Any
convert_int: Any
def __init__(self, convert_int: bool = ...) -> None: ...
def result_processor(self, dialect, coltype): ...
class ROWVERSION(TIMESTAMP):
__visit_name__: str
class NTEXT(sqltypes.UnicodeText):
__visit_name__: str
class VARBINARY(sqltypes.VARBINARY, sqltypes.LargeBinary):
__visit_name__: str
class IMAGE(sqltypes.LargeBinary):
__visit_name__: str
class XML(sqltypes.Text):
__visit_name__: str
class BIT(sqltypes.Boolean):
__visit_name__: str
class MONEY(sqltypes.TypeEngine):
__visit_name__: str
class SMALLMONEY(sqltypes.TypeEngine):
__visit_name__: str
class UNIQUEIDENTIFIER(sqltypes.TypeEngine):
__visit_name__: str
class SQL_VARIANT(sqltypes.TypeEngine):
__visit_name__: str
class TryCast(Cast):
__visit_name__: str
stringify_dialect: str
inherit_cache: bool
def __init__(self, *arg, **kw) -> None: ...
try_cast: Any
MSDateTime: Any
MSDate: Any
MSReal = REAL
MSTinyInteger = TINYINT
MSTime = TIME
MSSmallDateTime = SMALLDATETIME
MSDateTime2 = DATETIME2
MSDateTimeOffset = DATETIMEOFFSET
MSText = TEXT
MSNText = NTEXT
MSString = VARCHAR
MSNVarchar = NVARCHAR
MSChar = CHAR
MSNChar = NCHAR
MSBinary = BINARY
MSVarBinary = VARBINARY
MSImage = IMAGE
MSBit = BIT
MSMoney = MONEY
MSSmallMoney = SMALLMONEY
MSUniqueIdentifier = UNIQUEIDENTIFIER
MSVariant = SQL_VARIANT
ischema_names: Any
class MSTypeCompiler(compiler.GenericTypeCompiler):
def visit_FLOAT(self, type_, **kw): ...
def visit_TINYINT(self, type_, **kw): ...
def visit_TIME(self, type_, **kw): ...
def visit_TIMESTAMP(self, type_, **kw): ...
def visit_ROWVERSION(self, type_, **kw): ...
def visit_datetime(self, type_, **kw): ...
def visit_DATETIMEOFFSET(self, type_, **kw): ...
def visit_DATETIME2(self, type_, **kw): ...
def visit_SMALLDATETIME(self, type_, **kw): ...
def visit_unicode(self, type_, **kw): ...
def visit_text(self, type_, **kw): ...
def visit_unicode_text(self, type_, **kw): ...
def visit_NTEXT(self, type_, **kw): ...
def visit_TEXT(self, type_, **kw): ...
def visit_VARCHAR(self, type_, **kw): ...
def visit_CHAR(self, type_, **kw): ...
def visit_NCHAR(self, type_, **kw): ...
def visit_NVARCHAR(self, type_, **kw): ...
def visit_date(self, type_, **kw): ...
def visit__BASETIMEIMPL(self, type_, **kw): ...
def visit_time(self, type_, **kw): ...
def visit_large_binary(self, type_, **kw): ...
def visit_IMAGE(self, type_, **kw): ...
def visit_XML(self, type_, **kw): ...
def visit_VARBINARY(self, type_, **kw): ...
def visit_boolean(self, type_, **kw): ...
def visit_BIT(self, type_, **kw): ...
def visit_JSON(self, type_, **kw): ...
def visit_MONEY(self, type_, **kw): ...
def visit_SMALLMONEY(self, type_, **kw): ...
def visit_UNIQUEIDENTIFIER(self, type_, **kw): ...
def visit_SQL_VARIANT(self, type_, **kw): ...
class MSExecutionContext(default.DefaultExecutionContext):
def pre_exec(self) -> None: ...
cursor_fetch_strategy: Any
def post_exec(self) -> None: ...
def get_lastrowid(self): ...
@property
def rowcount(self): ...
def handle_dbapi_exception(self, e) -> None: ...
def get_result_cursor_strategy(self, result): ...
def fire_sequence(self, seq, type_): ...
def get_insert_default(self, column): ...
class MSSQLCompiler(compiler.SQLCompiler):
returning_precedes_values: bool
extract_map: Any
tablealiases: Any
def __init__(self, *args, **kwargs) -> None: ...
def visit_now_func(self, fn, **kw): ...
def visit_current_date_func(self, fn, **kw): ...
def visit_length_func(self, fn, **kw): ...
def visit_char_length_func(self, fn, **kw): ...
def visit_concat_op_binary(self, binary, operator, **kw): ...
def visit_true(self, expr, **kw): ...
def visit_false(self, expr, **kw): ...
def visit_match_op_binary(self, binary, operator, **kw): ...
def get_select_precolumns(self, select, **kw): ...
def get_from_hint_text(self, table, text): ...
def get_crud_hint_text(self, table, text): ...
def fetch_clause(self, cs, **kwargs): ...
def limit_clause(self, cs, **kwargs): ...
def visit_try_cast(self, element, **kw): ...
def translate_select_structure(self, select_stmt, **kwargs): ...
def visit_table(self, table, mssql_aliased: bool = ..., iscrud: bool = ..., **kwargs): ... # type: ignore[override]
def visit_alias(self, alias, **kw): ...
def visit_column(self, column, add_to_result_map: Any | None = ..., **kw): ... # type: ignore[override]
def visit_extract(self, extract, **kw): ...
def visit_savepoint(self, savepoint_stmt): ...
def visit_rollback_to_savepoint(self, savepoint_stmt): ...
def visit_binary(self, binary, **kwargs): ...
def returning_clause(self, stmt, returning_cols): ...
def get_cte_preamble(self, recursive): ...
def label_select_column(self, select, column, asfrom): ...
def for_update_clause(self, select, **kw): ...
def order_by_clause(self, select, **kw): ...
def update_from_clause(self, update_stmt, from_table, extra_froms, from_hints, **kw): ...
def delete_table_clause(self, delete_stmt, from_table, extra_froms): ...
def delete_extra_from_clause(self, delete_stmt, from_table, extra_froms, from_hints, **kw): ...
def visit_empty_set_expr(self, type_): ...
def visit_is_distinct_from_binary(self, binary, operator, **kw): ...
def visit_is_not_distinct_from_binary(self, binary, operator, **kw): ...
def visit_json_getitem_op_binary(self, binary, operator, **kw): ...
def visit_json_path_getitem_op_binary(self, binary, operator, **kw): ...
def visit_sequence(self, seq, **kw): ...
class MSSQLStrictCompiler(MSSQLCompiler):
ansi_bind_rules: bool
def visit_in_op_binary(self, binary, operator, **kw): ...
def visit_not_in_op_binary(self, binary, operator, **kw): ...
def render_literal_value(self, value, type_): ...
class MSDDLCompiler(compiler.DDLCompiler):
def get_column_specification(self, column, **kwargs): ...
def visit_create_index(self, create, include_schema: bool = ...): ... # type: ignore[override]
def visit_drop_index(self, drop): ...
def visit_primary_key_constraint(self, constraint): ...
def visit_unique_constraint(self, constraint): ...
def visit_computed_column(self, generated): ...
def visit_create_sequence(self, create, **kw): ...
def visit_identity_column(self, identity, **kw): ...
class MSIdentifierPreparer(compiler.IdentifierPreparer):
reserved_words: Any
def __init__(self, dialect) -> None: ...
def quote_schema(self, schema, force: Any | None = ...): ...
class MSDialect(default.DefaultDialect):
name: str
supports_statement_cache: bool
supports_default_values: bool
supports_empty_insert: bool
use_scope_identity: bool
max_identifier_length: int
schema_name: str
implicit_returning: bool
full_returning: bool
colspecs: Any
engine_config_types: Any
ischema_names: Any
supports_sequences: bool
sequences_optional: bool
default_sequence_base: int
supports_native_boolean: bool
non_native_boolean_check_constraint: bool
supports_unicode_binds: bool
postfetch_lastrowid: bool
legacy_schema_aliasing: bool
server_version_info: Any
statement_compiler: Any
ddl_compiler: Any
type_compiler: Any
preparer: Any
construct_arguments: Any
query_timeout: Any
deprecate_large_types: Any
isolation_level: Any
def __init__(
self,
query_timeout: Any | None = ...,
use_scope_identity: bool = ...,
schema_name: str = ...,
isolation_level: Any | None = ...,
deprecate_large_types: Any | None = ...,
json_serializer: Any | None = ...,
json_deserializer: Any | None = ...,
legacy_schema_aliasing: Any | None = ...,
**opts,
) -> None: ...
def do_savepoint(self, connection, name) -> None: ...
def do_release_savepoint(self, connection, name) -> None: ...
def set_isolation_level(self, connection, level) -> None: ...
def get_isolation_level(self, connection): ...
def initialize(self, connection) -> None: ...
def on_connect(self): ...
def has_table(self, connection, tablename, dbname, owner, schema): ...
def has_sequence(self, connection, sequencename, dbname, owner, schema): ...
def get_sequence_names(self, connection, dbname, owner, schema, **kw): ...
def get_schema_names(self, connection, **kw): ...
def get_table_names(self, connection, dbname, owner, schema, **kw): ...
def get_view_names(self, connection, dbname, owner, schema, **kw): ...
def get_indexes(self, connection, tablename, dbname, owner, schema, **kw): ...
def get_view_definition(self, connection, viewname, dbname, owner, schema, **kw): ...
def get_columns(self, connection, tablename, dbname, owner, schema, **kw): ...
def get_pk_constraint(self, connection, tablename, dbname, owner, schema, **kw): ...
def get_foreign_keys(self, connection, tablename, dbname, owner, schema, **kw): ...

View File

@ -0,0 +1,35 @@
from typing import Any
from ...sql import expression
from ...types import TypeDecorator
ischema: Any
class CoerceUnicode(TypeDecorator):
impl: Any
cache_ok: bool
def process_bind_param(self, value, dialect): ...
def bind_expression(self, bindvalue): ...
class _cast_on_2005(expression.ColumnElement):
bindvalue: Any
def __init__(self, bindvalue) -> None: ...
schemata: Any
tables: Any
columns: Any
mssql_temp_table_columns: Any
constraints: Any
column_constraints: Any
key_constraints: Any
ref_constraints: Any
views: Any
computed_columns: Any
sequences: Any
class IdentitySqlVariant(TypeDecorator):
impl: Any
cache_ok: bool
def column_expression(self, colexpr): ...
identity_columns: Any

View File

@ -0,0 +1,10 @@
from ...types import JSON as _JSON
class JSON(_JSON): ...
class _FormatTypeMixin:
def bind_processor(self, dialect): ...
def literal_processor(self, dialect): ...
class JSONIndexType(_FormatTypeMixin, _JSON.JSONIndexType): ...
class JSONPathType(_FormatTypeMixin, _JSON.JSONPathType): ...

View File

@ -0,0 +1,26 @@
from typing import Any
from ...connectors.mxodbc import MxODBCConnector
from .base import VARBINARY, MSDialect, _MSDate, _MSTime
from .pyodbc import MSExecutionContext_pyodbc, _MSNumeric_pyodbc
class _MSNumeric_mxodbc(_MSNumeric_pyodbc): ...
class _MSDate_mxodbc(_MSDate):
def bind_processor(self, dialect): ...
class _MSTime_mxodbc(_MSTime):
def bind_processor(self, dialect): ...
class _VARBINARY_mxodbc(VARBINARY):
def bind_processor(self, dialect): ...
class MSExecutionContext_mxodbc(MSExecutionContext_pyodbc): ...
class MSDialect_mxodbc(MxODBCConnector, MSDialect):
supports_statement_cache: bool
colspecs: Any
description_encoding: Any
def __init__(self, description_encoding: Any | None = ..., **params) -> None: ...
dialect = MSDialect_mxodbc

View File

@ -0,0 +1,24 @@
from typing import Any
from ...types import Numeric
from .base import MSDialect, MSIdentifierPreparer
class _MSNumeric_pymssql(Numeric):
def result_processor(self, dialect, type_): ...
class MSIdentifierPreparer_pymssql(MSIdentifierPreparer):
def __init__(self, dialect) -> None: ...
class MSDialect_pymssql(MSDialect):
supports_statement_cache: bool
supports_native_decimal: bool
driver: str
preparer: Any
colspecs: Any
@classmethod
def dbapi(cls): ...
def create_connect_args(self, url): ...
def is_disconnect(self, e, connection, cursor): ...
def set_isolation_level(self, connection, level) -> None: ...
dialect = MSDialect_pymssql

View File

@ -0,0 +1,44 @@
from typing import Any
from ...connectors.pyodbc import PyODBCConnector
from ...types import DateTime, Float, Numeric
from .base import BINARY, DATETIMEOFFSET, VARBINARY, MSDialect, MSExecutionContext
class _ms_numeric_pyodbc:
def bind_processor(self, dialect): ...
class _MSNumeric_pyodbc(_ms_numeric_pyodbc, Numeric): ...
class _MSFloat_pyodbc(_ms_numeric_pyodbc, Float): ...
class _ms_binary_pyodbc:
def bind_processor(self, dialect): ...
class _ODBCDateTimeBindProcessor:
has_tz: bool
def bind_processor(self, dialect): ...
class _ODBCDateTime(_ODBCDateTimeBindProcessor, DateTime): ...
class _ODBCDATETIMEOFFSET(_ODBCDateTimeBindProcessor, DATETIMEOFFSET):
has_tz: bool
class _VARBINARY_pyodbc(_ms_binary_pyodbc, VARBINARY): ...
class _BINARY_pyodbc(_ms_binary_pyodbc, BINARY): ...
class MSExecutionContext_pyodbc(MSExecutionContext):
def pre_exec(self) -> None: ...
def post_exec(self) -> None: ...
class MSDialect_pyodbc(PyODBCConnector, MSDialect):
supports_statement_cache: bool
supports_sane_rowcount_returning: bool
colspecs: Any
description_encoding: Any
use_scope_identity: Any
fast_executemany: Any
def __init__(self, description_encoding: Any | None = ..., fast_executemany: bool = ..., **params) -> None: ...
def on_connect(self): ...
def do_executemany(self, cursor, statement, parameters, context: Any | None = ...) -> None: ...
def is_disconnect(self, e, connection, cursor): ...
dialect = MSDialect_pyodbc

View File

@ -0,0 +1,85 @@
from typing import Any
from .base import (
BIGINT as BIGINT,
BINARY as BINARY,
BIT as BIT,
BLOB as BLOB,
BOOLEAN as BOOLEAN,
CHAR as CHAR,
DATE as DATE,
DATETIME as DATETIME,
DECIMAL as DECIMAL,
DOUBLE as DOUBLE,
ENUM as ENUM,
FLOAT as FLOAT,
INTEGER as INTEGER,
JSON as JSON,
LONGBLOB as LONGBLOB,
LONGTEXT as LONGTEXT,
MEDIUMBLOB as MEDIUMBLOB,
MEDIUMINT as MEDIUMINT,
MEDIUMTEXT as MEDIUMTEXT,
NCHAR as NCHAR,
NUMERIC as NUMERIC,
NVARCHAR as NVARCHAR,
REAL as REAL,
SET as SET,
SMALLINT as SMALLINT,
TEXT as TEXT,
TIME as TIME,
TIMESTAMP as TIMESTAMP,
TINYBLOB as TINYBLOB,
TINYINT as TINYINT,
TINYTEXT as TINYTEXT,
VARBINARY as VARBINARY,
VARCHAR as VARCHAR,
YEAR as YEAR,
)
from .dml import Insert as Insert, insert as insert
from .expression import match as match
__all__ = (
"BIGINT",
"BINARY",
"BIT",
"BLOB",
"BOOLEAN",
"CHAR",
"DATE",
"DATETIME",
"DECIMAL",
"DOUBLE",
"ENUM",
"DECIMAL",
"FLOAT",
"INTEGER",
"INTEGER",
"JSON",
"LONGBLOB",
"LONGTEXT",
"MEDIUMBLOB",
"MEDIUMINT",
"MEDIUMTEXT",
"NCHAR",
"NVARCHAR",
"NUMERIC",
"SET",
"SMALLINT",
"REAL",
"TEXT",
"TIME",
"TIMESTAMP",
"TINYBLOB",
"TINYINT",
"TINYTEXT",
"VARBINARY",
"VARCHAR",
"YEAR",
"dialect",
"insert",
"Insert",
"match",
)
dialect: Any

View File

@ -0,0 +1,73 @@
from typing import Any
from ...engine import AdaptedConnection
from .pymysql import MySQLDialect_pymysql
class AsyncAdapt_aiomysql_cursor:
server_side: bool
await_: Any
def __init__(self, adapt_connection) -> None: ...
@property
def description(self): ...
@property
def rowcount(self): ...
@property
def arraysize(self): ...
@arraysize.setter
def arraysize(self, value) -> None: ...
@property
def lastrowid(self): ...
def close(self) -> None: ...
def execute(self, operation, parameters: Any | None = ...): ...
def executemany(self, operation, seq_of_parameters): ...
def setinputsizes(self, *inputsizes) -> None: ...
def __iter__(self): ...
def fetchone(self): ...
def fetchmany(self, size: Any | None = ...): ...
def fetchall(self): ...
class AsyncAdapt_aiomysql_ss_cursor(AsyncAdapt_aiomysql_cursor):
server_side: bool
await_: Any
def __init__(self, adapt_connection) -> None: ...
def close(self) -> None: ...
def fetchone(self): ...
def fetchmany(self, size: Any | None = ...): ...
def fetchall(self): ...
class AsyncAdapt_aiomysql_connection(AdaptedConnection):
await_: Any
dbapi: Any
def __init__(self, dbapi, connection) -> None: ...
def ping(self, reconnect): ...
def character_set_name(self): ...
def autocommit(self, value) -> None: ...
def cursor(self, server_side: bool = ...): ...
def rollback(self) -> None: ...
def commit(self) -> None: ...
def close(self) -> None: ...
class AsyncAdaptFallback_aiomysql_connection(AsyncAdapt_aiomysql_connection):
await_: Any
class AsyncAdapt_aiomysql_dbapi:
aiomysql: Any
pymysql: Any
paramstyle: str
def __init__(self, aiomysql, pymysql) -> None: ...
def connect(self, *arg, **kw): ...
class MySQLDialect_aiomysql(MySQLDialect_pymysql):
driver: str
supports_statement_cache: bool
supports_server_side_cursors: bool
is_async: bool
@classmethod
def dbapi(cls): ...
@classmethod
def get_pool_class(cls, url): ...
def create_connect_args(self, url): ...
def is_disconnect(self, e, connection, cursor): ...
def get_driver_connection(self, connection): ...
dialect = MySQLDialect_aiomysql

View File

@ -0,0 +1,73 @@
from typing import Any
from ...engine import AdaptedConnection
from .pymysql import MySQLDialect_pymysql
class AsyncAdapt_asyncmy_cursor:
server_side: bool
await_: Any
def __init__(self, adapt_connection) -> None: ...
@property
def description(self): ...
@property
def rowcount(self): ...
@property
def arraysize(self): ...
@arraysize.setter
def arraysize(self, value) -> None: ...
@property
def lastrowid(self): ...
def close(self) -> None: ...
def execute(self, operation, parameters: Any | None = ...): ...
def executemany(self, operation, seq_of_parameters): ...
def setinputsizes(self, *inputsizes) -> None: ...
def __iter__(self): ...
def fetchone(self): ...
def fetchmany(self, size: Any | None = ...): ...
def fetchall(self): ...
class AsyncAdapt_asyncmy_ss_cursor(AsyncAdapt_asyncmy_cursor):
server_side: bool
await_: Any
def __init__(self, adapt_connection) -> None: ...
def close(self) -> None: ...
def fetchone(self): ...
def fetchmany(self, size: Any | None = ...): ...
def fetchall(self): ...
class AsyncAdapt_asyncmy_connection(AdaptedConnection):
await_: Any
dbapi: Any
def __init__(self, dbapi, connection) -> None: ...
def ping(self, reconnect): ...
def character_set_name(self): ...
def autocommit(self, value) -> None: ...
def cursor(self, server_side: bool = ...): ...
def rollback(self) -> None: ...
def commit(self) -> None: ...
def close(self) -> None: ...
class AsyncAdaptFallback_asyncmy_connection(AsyncAdapt_asyncmy_connection):
await_: Any
class AsyncAdapt_asyncmy_dbapi:
asyncmy: Any
pymysql: Any
paramstyle: str
def __init__(self, asyncmy, pymysql) -> None: ...
def connect(self, *arg, **kw): ...
class MySQLDialect_asyncmy(MySQLDialect_pymysql):
driver: str
supports_statement_cache: bool
supports_server_side_cursors: bool
is_async: bool
@classmethod
def dbapi(cls): ...
@classmethod
def get_pool_class(cls, url): ...
def create_connect_args(self, url): ...
def is_disconnect(self, e, connection, cursor): ...
def get_driver_connection(self, connection): ...
dialect = MySQLDialect_asyncmy

View File

@ -0,0 +1,239 @@
from typing import Any
from ...engine import default
from ...sql import compiler
from ...types import BINARY as BINARY, BLOB as BLOB, BOOLEAN as BOOLEAN, DATE as DATE, VARBINARY as VARBINARY
from .enumerated import ENUM as ENUM, SET as SET
from .json import JSON as JSON
from .types import (
BIGINT as BIGINT,
BIT as BIT,
CHAR as CHAR,
DATETIME as DATETIME,
DECIMAL as DECIMAL,
DOUBLE as DOUBLE,
FLOAT as FLOAT,
INTEGER as INTEGER,
LONGBLOB as LONGBLOB,
LONGTEXT as LONGTEXT,
MEDIUMBLOB as MEDIUMBLOB,
MEDIUMINT as MEDIUMINT,
MEDIUMTEXT as MEDIUMTEXT,
NCHAR as NCHAR,
NUMERIC as NUMERIC,
NVARCHAR as NVARCHAR,
REAL as REAL,
SMALLINT as SMALLINT,
TEXT as TEXT,
TIME as TIME,
TIMESTAMP as TIMESTAMP,
TINYBLOB as TINYBLOB,
TINYINT as TINYINT,
TINYTEXT as TINYTEXT,
VARCHAR as VARCHAR,
YEAR as YEAR,
)
AUTOCOMMIT_RE: Any
SET_RE: Any
MSTime = TIME
MSSet = SET
MSEnum = ENUM
MSLongBlob = LONGBLOB
MSMediumBlob = MEDIUMBLOB
MSTinyBlob = TINYBLOB
MSBlob = BLOB
MSBinary = BINARY
MSVarBinary = VARBINARY
MSNChar = NCHAR
MSNVarChar = NVARCHAR
MSChar = CHAR
MSString = VARCHAR
MSLongText = LONGTEXT
MSMediumText = MEDIUMTEXT
MSTinyText = TINYTEXT
MSText = TEXT
MSYear = YEAR
MSTimeStamp = TIMESTAMP
MSBit = BIT
MSSmallInteger = SMALLINT
MSTinyInteger = TINYINT
MSMediumInteger = MEDIUMINT
MSBigInteger = BIGINT
MSNumeric = NUMERIC
MSDecimal = DECIMAL
MSDouble = DOUBLE
MSReal = REAL
MSFloat = FLOAT
MSInteger = INTEGER
colspecs: Any
ischema_names: Any
class MySQLExecutionContext(default.DefaultExecutionContext):
def should_autocommit_text(self, statement): ...
def create_server_side_cursor(self): ...
def fire_sequence(self, seq, type_): ...
class MySQLCompiler(compiler.SQLCompiler):
render_table_with_column_in_update_from: bool
extract_map: Any
def default_from(self): ...
def visit_random_func(self, fn, **kw): ...
def visit_sequence(self, seq, **kw): ...
def visit_sysdate_func(self, fn, **kw): ...
def visit_json_getitem_op_binary(self, binary, operator, **kw): ...
def visit_json_path_getitem_op_binary(self, binary, operator, **kw): ...
def visit_on_duplicate_key_update(self, on_duplicate, **kw): ...
def visit_concat_op_binary(self, binary, operator, **kw): ...
def visit_mysql_match(self, element, **kw): ...
def visit_match_op_binary(self, binary, operator, **kw): ...
def get_from_hint_text(self, table, text): ...
def visit_typeclause(self, typeclause, type_: Any | None = ..., **kw): ...
def visit_cast(self, cast, **kw): ...
def render_literal_value(self, value, type_): ...
def visit_true(self, element, **kw): ...
def visit_false(self, element, **kw): ...
def get_select_precolumns(self, select, **kw): ...
def visit_join(self, join, asfrom: bool = ..., from_linter: Any | None = ..., **kwargs): ...
def for_update_clause(self, select, **kw): ...
def limit_clause(self, select, **kw): ...
def update_limit_clause(self, update_stmt): ...
def update_tables_clause(self, update_stmt, from_table, extra_froms, **kw): ...
def update_from_clause(self, update_stmt, from_table, extra_froms, from_hints, **kw) -> None: ...
def delete_table_clause(self, delete_stmt, from_table, extra_froms): ...
def delete_extra_from_clause(self, delete_stmt, from_table, extra_froms, from_hints, **kw): ...
def visit_empty_set_expr(self, element_types): ...
def visit_is_distinct_from_binary(self, binary, operator, **kw): ...
def visit_is_not_distinct_from_binary(self, binary, operator, **kw): ...
def visit_regexp_match_op_binary(self, binary, operator, **kw): ...
def visit_not_regexp_match_op_binary(self, binary, operator, **kw): ...
def visit_regexp_replace_op_binary(self, binary, operator, **kw): ...
class MySQLDDLCompiler(compiler.DDLCompiler):
def get_column_specification(self, column, **kw): ...
def post_create_table(self, table): ...
def visit_create_index(self, create, **kw): ...
def visit_primary_key_constraint(self, constraint): ...
def visit_drop_index(self, drop): ...
def visit_drop_constraint(self, drop): ...
def define_constraint_match(self, constraint): ...
def visit_set_table_comment(self, create): ...
def visit_drop_table_comment(self, create): ...
def visit_set_column_comment(self, create): ...
class MySQLTypeCompiler(compiler.GenericTypeCompiler):
def visit_NUMERIC(self, type_, **kw): ...
def visit_DECIMAL(self, type_, **kw): ...
def visit_DOUBLE(self, type_, **kw): ...
def visit_REAL(self, type_, **kw): ...
def visit_FLOAT(self, type_, **kw): ...
def visit_INTEGER(self, type_, **kw): ...
def visit_BIGINT(self, type_, **kw): ...
def visit_MEDIUMINT(self, type_, **kw): ...
def visit_TINYINT(self, type_, **kw): ...
def visit_SMALLINT(self, type_, **kw): ...
def visit_BIT(self, type_, **kw): ...
def visit_DATETIME(self, type_, **kw): ...
def visit_DATE(self, type_, **kw): ...
def visit_TIME(self, type_, **kw): ...
def visit_TIMESTAMP(self, type_, **kw): ...
def visit_YEAR(self, type_, **kw): ...
def visit_TEXT(self, type_, **kw): ...
def visit_TINYTEXT(self, type_, **kw): ...
def visit_MEDIUMTEXT(self, type_, **kw): ...
def visit_LONGTEXT(self, type_, **kw): ...
def visit_VARCHAR(self, type_, **kw): ...
def visit_CHAR(self, type_, **kw): ...
def visit_NVARCHAR(self, type_, **kw): ...
def visit_NCHAR(self, type_, **kw): ...
def visit_VARBINARY(self, type_, **kw): ...
def visit_JSON(self, type_, **kw): ...
def visit_large_binary(self, type_, **kw): ...
def visit_enum(self, type_, **kw): ...
def visit_BLOB(self, type_, **kw): ...
def visit_TINYBLOB(self, type_, **kw): ...
def visit_MEDIUMBLOB(self, type_, **kw): ...
def visit_LONGBLOB(self, type_, **kw): ...
def visit_ENUM(self, type_, **kw): ...
def visit_SET(self, type_, **kw): ...
def visit_BOOLEAN(self, type_, **kw): ...
class MySQLIdentifierPreparer(compiler.IdentifierPreparer):
reserved_words: Any
def __init__(self, dialect, server_ansiquotes: bool = ..., **kw) -> None: ...
class MariaDBIdentifierPreparer(MySQLIdentifierPreparer):
reserved_words: Any
class MySQLDialect(default.DefaultDialect):
logger: Any
name: str
supports_statement_cache: bool
supports_alter: bool
supports_native_boolean: bool
max_identifier_length: int
max_index_name_length: int
max_constraint_name_length: int
supports_native_enum: bool
supports_sequences: bool
sequences_optional: bool
supports_for_update_of: bool
supports_default_values: bool
supports_default_metavalue: bool
supports_sane_rowcount: bool
supports_sane_multi_rowcount: bool
supports_multivalues_insert: bool
supports_comments: bool
inline_comments: bool
default_paramstyle: str
colspecs: Any
cte_follows_insert: bool
statement_compiler: Any
ddl_compiler: Any
type_compiler: Any
ischema_names: Any
preparer: Any
is_mariadb: bool
construct_arguments: Any
isolation_level: Any
def __init__(
self,
isolation_level: Any | None = ...,
json_serializer: Any | None = ...,
json_deserializer: Any | None = ...,
is_mariadb: Any | None = ...,
**kwargs,
) -> None: ...
def on_connect(self): ...
def set_isolation_level(self, connection, level) -> None: ...
def get_isolation_level(self, connection): ...
def do_begin_twophase(self, connection, xid) -> None: ...
def do_prepare_twophase(self, connection, xid) -> None: ...
def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ...
def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ...
def do_recover_twophase(self, connection): ...
def is_disconnect(self, e, connection, cursor): ...
def has_table(self, connection, table_name, schema: Any | None = ...): ... # type: ignore[override]
def has_sequence(self, connection, sequence_name, schema: Any | None = ...): ... # type: ignore[override]
def get_sequence_names(self, connection, schema: Any | None = ..., **kw): ...
identifier_preparer: Any
def initialize(self, connection) -> None: ...
def get_schema_names(self, connection, **kw): ...
def get_table_names(self, connection, schema: Any | None = ..., **kw): ...
def get_view_names(self, connection, schema: Any | None = ..., **kw): ...
def get_table_options(self, connection, table_name, schema: Any | None = ..., **kw): ...
def get_columns(self, connection, table_name, schema: Any | None = ..., **kw): ...
def get_pk_constraint(self, connection, table_name, schema: Any | None = ..., **kw): ...
def get_foreign_keys(self, connection, table_name, schema: Any | None = ..., **kw): ...
def get_check_constraints(self, connection, table_name, schema: Any | None = ..., **kw): ...
def get_table_comment(self, connection, table_name, schema: Any | None = ..., **kw): ...
def get_indexes(self, connection, table_name, schema: Any | None = ..., **kw): ...
def get_unique_constraints(self, connection, table_name, schema: Any | None = ..., **kw): ...
def get_view_definition(self, connection, view_name, schema: Any | None = ..., **kw): ...
class _DecodingRow:
rowproxy: Any
charset: Any
def __init__(self, rowproxy, charset) -> None: ...
def __getitem__(self, index): ...
def __getattr__(self, attr): ...

View File

@ -0,0 +1,21 @@
from typing import Any
from .base import BIT
from .mysqldb import MySQLDialect_mysqldb
class _cymysqlBIT(BIT):
def result_processor(self, dialect, coltype): ...
class MySQLDialect_cymysql(MySQLDialect_mysqldb):
driver: str
supports_statement_cache: bool
description_encoding: Any
supports_sane_rowcount: bool
supports_sane_multi_rowcount: bool
supports_unicode_statements: bool
colspecs: Any
@classmethod
def dbapi(cls): ...
def is_disconnect(self, e, connection, cursor): ...
dialect = MySQLDialect_cymysql

View File

@ -0,0 +1,23 @@
from typing import Any
from ...sql.dml import Insert as StandardInsert
from ...sql.elements import ClauseElement
from ...util import memoized_property
class Insert(StandardInsert):
stringify_dialect: str
inherit_cache: bool
@property
def inserted(self): ...
@memoized_property
def inserted_alias(self): ...
def on_duplicate_key_update(self, *args, **kw) -> None: ...
insert: Any
class OnDuplicateClause(ClauseElement):
__visit_name__: str
stringify_dialect: str
inserted_alias: Any
update: Any
def __init__(self, inserted_alias, update) -> None: ...

View File

@ -0,0 +1,21 @@
from typing import Any
from ...sql import sqltypes
from .types import _StringType
class ENUM(sqltypes.NativeForEmulated, sqltypes.Enum, _StringType): # type: ignore[misc]
__visit_name__: str
native_enum: bool
def __init__(self, *enums, **kw) -> None: ...
@classmethod
def adapt_emulated_to_native(cls, impl, **kw): ...
class SET(_StringType):
__visit_name__: str
retrieve_as_bitwise: Any
values: Any
def __init__(self, *values, **kw) -> None: ...
def column_expression(self, colexpr): ...
def result_processor(self, dialect, coltype): ...
def bind_processor(self, dialect): ...
def adapt(self, impltype, **kw): ...

View File

@ -0,0 +1,13 @@
from typing import Any
from ...sql import elements
from ...sql.base import Generative
class match(Generative, elements.BinaryExpression):
__visit_name__: str
inherit_cache: bool
def __init__(self, *cols, **kw) -> None: ...
modifiers: Any
def in_boolean_mode(self) -> None: ...
def in_natural_language_mode(self) -> None: ...
def with_query_expansion(self) -> None: ...

View File

@ -0,0 +1,10 @@
import sqlalchemy.types as sqltypes
class JSON(sqltypes.JSON): ...
class _FormatTypeMixin:
def bind_processor(self, dialect): ...
def literal_processor(self, dialect): ...
class JSONIndexType(_FormatTypeMixin, sqltypes.JSON.JSONIndexType): ...
class JSONPathType(_FormatTypeMixin, sqltypes.JSON.JSONPathType): ...

View File

@ -0,0 +1,11 @@
from typing import Any
from .base import MySQLDialect
class MariaDBDialect(MySQLDialect):
is_mariadb: bool
supports_statement_cache: bool
name: str
preparer: Any
def loader(driver): ...

View File

@ -0,0 +1,36 @@
from typing import Any
from .base import MySQLCompiler, MySQLDialect, MySQLExecutionContext
mariadb_cpy_minimum_version: Any
class MySQLExecutionContext_mariadbconnector(MySQLExecutionContext):
def create_server_side_cursor(self): ...
def create_default_cursor(self): ...
class MySQLCompiler_mariadbconnector(MySQLCompiler): ...
class MySQLDialect_mariadbconnector(MySQLDialect):
driver: str
supports_statement_cache: bool
supports_unicode_statements: bool
encoding: str
convert_unicode: bool
supports_sane_rowcount: bool
supports_sane_multi_rowcount: bool
supports_native_decimal: bool
default_paramstyle: str
statement_compiler: Any
supports_server_side_cursors: bool
paramstyle: str
def __init__(self, **kwargs) -> None: ...
@classmethod
def dbapi(cls): ...
def is_disconnect(self, e, connection, cursor): ...
def create_connect_args(self, url): ...
def do_begin_twophase(self, connection, xid) -> None: ...
def do_prepare_twophase(self, connection, xid) -> None: ...
def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ...
def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ...
dialect = MySQLDialect_mariadbconnector

View File

@ -0,0 +1,38 @@
from typing import Any
from ...util import memoized_property
from .base import BIT, MySQLCompiler, MySQLDialect, MySQLIdentifierPreparer
class MySQLCompiler_mysqlconnector(MySQLCompiler):
def visit_mod_binary(self, binary, operator, **kw): ...
def post_process_text(self, text): ...
def escape_literal_column(self, text): ...
class MySQLIdentifierPreparer_mysqlconnector(MySQLIdentifierPreparer): ...
class _myconnpyBIT(BIT):
def result_processor(self, dialect, coltype) -> None: ...
class MySQLDialect_mysqlconnector(MySQLDialect):
driver: str
supports_statement_cache: bool
supports_unicode_binds: bool
supports_sane_rowcount: bool
supports_sane_multi_rowcount: bool
supports_native_decimal: bool
default_paramstyle: str
statement_compiler: Any
preparer: Any
colspecs: Any
def __init__(self, *arg, **kw) -> None: ...
@property
def description_encoding(self): ...
@memoized_property
def supports_unicode_statements(self): ...
@classmethod
def dbapi(cls): ...
def do_ping(self, dbapi_connection): ...
def create_connect_args(self, url): ...
def is_disconnect(self, e, connection, cursor): ...
dialect = MySQLDialect_mysqlconnector

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