mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-15 21:18:30 +08:00
Bump mypy to 1.11.1 (#12463)
This commit is contained in:
@@ -51,8 +51,6 @@ jobs:
|
||||
check-latest: true
|
||||
- name: Install dependencies
|
||||
run: pip install -r requirements-tests.txt
|
||||
- name: Install mypy from git
|
||||
run: pip install git+https://github.com/python/mypy@e8a26308d5d06925cf769b62f41ef2e4bc546ada
|
||||
- name: Run stubtest
|
||||
run: python tests/stubtest_stdlib.py
|
||||
|
||||
|
||||
@@ -47,7 +47,5 @@ jobs:
|
||||
check-latest: true
|
||||
- name: Install dependencies
|
||||
run: pip install -r requirements-tests.txt
|
||||
- name: Install mypy from git
|
||||
run: pip install git+https://github.com/python/mypy@e8a26308d5d06925cf769b62f41ef2e4bc546ada
|
||||
- name: Run stubtest
|
||||
run: python tests/stubtest_stdlib.py
|
||||
|
||||
@@ -5,7 +5,7 @@ black==24.4.2 # must match .pre-commit-config.yaml
|
||||
flake8==7.1.0 # must match .pre-commit-config.yaml
|
||||
flake8-noqa==1.4.0 # must match .pre-commit-config.yaml
|
||||
flake8-pyi==24.6.0 # must match .pre-commit-config.yaml
|
||||
mypy==1.10.1
|
||||
mypy==1.11.1
|
||||
pre-commit-hooks==4.6.0 # must match .pre-commit-config.yaml
|
||||
pyright==1.1.374
|
||||
pytype==2024.4.11; platform_system != "Windows" and python_version < "3.12"
|
||||
|
||||
@@ -7,8 +7,8 @@ from typing_extensions import assert_type
|
||||
|
||||
A = enum.Enum("A", "spam eggs bacon")
|
||||
B = enum.Enum("B", ["spam", "eggs", "bacon"])
|
||||
C = enum.Enum("Bar", [("spam", 1), ("eggs", 2), ("bacon", 3)])
|
||||
D = enum.Enum("Bar", {"spam": 1, "eggs": 2})
|
||||
C = enum.Enum("C", [("spam", 1), ("eggs", 2), ("bacon", 3)])
|
||||
D = enum.Enum("D", {"spam": 1, "eggs": 2})
|
||||
|
||||
assert_type(A, Type[A])
|
||||
assert_type(B, Type[B])
|
||||
|
||||
@@ -151,13 +151,13 @@ if sys.version_info >= (3, 10):
|
||||
@overload
|
||||
def gather(*coros_or_futures: _FutureLike[_T], return_exceptions: Literal[False] = False) -> Future[list[_T]]: ... # type: ignore[overload-overlap]
|
||||
@overload
|
||||
def gather(coro_or_future1: _FutureLike[_T1], /, *, return_exceptions: bool) -> Future[tuple[_T1 | BaseException]]: ... # type: ignore[overload-overlap]
|
||||
def gather(coro_or_future1: _FutureLike[_T1], /, *, return_exceptions: bool) -> Future[tuple[_T1 | BaseException]]: ...
|
||||
@overload
|
||||
def gather( # type: ignore[overload-overlap]
|
||||
def gather(
|
||||
coro_or_future1: _FutureLike[_T1], coro_or_future2: _FutureLike[_T2], /, *, return_exceptions: bool
|
||||
) -> Future[tuple[_T1 | BaseException, _T2 | BaseException]]: ...
|
||||
@overload
|
||||
def gather( # type: ignore[overload-overlap]
|
||||
def gather(
|
||||
coro_or_future1: _FutureLike[_T1],
|
||||
coro_or_future2: _FutureLike[_T2],
|
||||
coro_or_future3: _FutureLike[_T3],
|
||||
@@ -166,7 +166,7 @@ if sys.version_info >= (3, 10):
|
||||
return_exceptions: bool,
|
||||
) -> Future[tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException]]: ...
|
||||
@overload
|
||||
def gather( # type: ignore[overload-overlap]
|
||||
def gather(
|
||||
coro_or_future1: _FutureLike[_T1],
|
||||
coro_or_future2: _FutureLike[_T2],
|
||||
coro_or_future3: _FutureLike[_T3],
|
||||
@@ -176,7 +176,7 @@ if sys.version_info >= (3, 10):
|
||||
return_exceptions: bool,
|
||||
) -> Future[tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException]]: ...
|
||||
@overload
|
||||
def gather( # type: ignore[overload-overlap]
|
||||
def gather(
|
||||
coro_or_future1: _FutureLike[_T1],
|
||||
coro_or_future2: _FutureLike[_T2],
|
||||
coro_or_future3: _FutureLike[_T3],
|
||||
@@ -189,7 +189,7 @@ if sys.version_info >= (3, 10):
|
||||
tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException, _T5 | BaseException]
|
||||
]: ...
|
||||
@overload
|
||||
def gather( # type: ignore[overload-overlap]
|
||||
def gather(
|
||||
coro_or_future1: _FutureLike[_T1],
|
||||
coro_or_future2: _FutureLike[_T2],
|
||||
coro_or_future3: _FutureLike[_T3],
|
||||
|
||||
@@ -159,7 +159,7 @@ if sys.platform != "win32":
|
||||
|
||||
class _UnixSelectorEventLoop(BaseSelectorEventLoop):
|
||||
if sys.version_info >= (3, 13):
|
||||
async def create_unix_server( # type: ignore[override]
|
||||
async def create_unix_server(
|
||||
self,
|
||||
protocol_factory: _ProtocolFactory,
|
||||
path: StrPath | None = None,
|
||||
|
||||
+2
-3
@@ -1744,7 +1744,7 @@ _SupportsSumNoDefaultT = TypeVar("_SupportsSumNoDefaultT", bound=_SupportsSumWit
|
||||
# without creating many false-positive errors (see #7578).
|
||||
# Instead, we special-case the most common examples of this: bool and literal integers.
|
||||
@overload
|
||||
def sum(iterable: Iterable[bool | _LiteralInteger], /, start: int = 0) -> int: ... # type: ignore[overload-overlap]
|
||||
def sum(iterable: Iterable[bool | _LiteralInteger], /, start: int = 0) -> int: ...
|
||||
@overload
|
||||
def sum(iterable: Iterable[_SupportsSumNoDefaultT], /) -> _SupportsSumNoDefaultT | Literal[0]: ...
|
||||
@overload
|
||||
@@ -1752,9 +1752,8 @@ def sum(iterable: Iterable[_AddableT1], /, start: _AddableT2) -> _AddableT1 | _A
|
||||
|
||||
# The argument to `vars()` has to have a `__dict__` attribute, so the second overload can't be annotated with `object`
|
||||
# (A "SupportsDunderDict" protocol doesn't work)
|
||||
# Use a type: ignore to make complaints about overlapping overloads go away
|
||||
@overload
|
||||
def vars(object: type, /) -> types.MappingProxyType[str, Any]: ... # type: ignore[overload-overlap]
|
||||
def vars(object: type, /) -> types.MappingProxyType[str, Any]: ...
|
||||
@overload
|
||||
def vars(object: Any = ..., /) -> dict[str, Any]: ...
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ if sys.version_info >= (3, 10) and sys.version_info < (3, 12):
|
||||
@property
|
||||
def names(self) -> set[str]: ...
|
||||
@overload
|
||||
def select(self) -> Self: ... # type: ignore[misc]
|
||||
def select(self) -> Self: ...
|
||||
@overload
|
||||
def select(
|
||||
self,
|
||||
@@ -277,7 +277,7 @@ if sys.version_info >= (3, 12):
|
||||
|
||||
elif sys.version_info >= (3, 10):
|
||||
@overload
|
||||
def entry_points() -> SelectableGroups: ... # type: ignore[overload-overlap]
|
||||
def entry_points() -> SelectableGroups: ...
|
||||
@overload
|
||||
def entry_points(
|
||||
*, name: str = ..., value: str = ..., group: str = ..., module: str = ..., attr: str = ..., extras: list[str] = ...
|
||||
|
||||
@@ -6,7 +6,7 @@ from ..pytree import Node
|
||||
|
||||
class FixUnicode(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[Literal["STRING | 'unicode' | 'unichr'"]] # type: ignore[name-defined] # Name "STRING" is not defined
|
||||
PATTERN: ClassVar[str]
|
||||
unicode_literals: bool
|
||||
def start_tree(self, tree: Node, filename: StrPath) -> None: ...
|
||||
def transform(self, node, results): ...
|
||||
|
||||
@@ -73,7 +73,7 @@ def copy(obj: _CT) -> _CT: ...
|
||||
@overload
|
||||
def synchronized(obj: _SimpleCData[_T], lock: _LockLike | None = None, ctx: Any | None = None) -> Synchronized[_T]: ...
|
||||
@overload
|
||||
def synchronized(obj: ctypes.Array[c_char], lock: _LockLike | None = None, ctx: Any | None = None) -> SynchronizedString: ... # type: ignore
|
||||
def synchronized(obj: ctypes.Array[c_char], lock: _LockLike | None = None, ctx: Any | None = None) -> SynchronizedString: ...
|
||||
@overload
|
||||
def synchronized(
|
||||
obj: ctypes.Array[_SimpleCData[_T]], lock: _LockLike | None = None, ctx: Any | None = None
|
||||
@@ -115,12 +115,12 @@ class SynchronizedArray(SynchronizedBase[ctypes.Array[_SimpleCData[_T]]], Generi
|
||||
class SynchronizedString(SynchronizedArray[bytes]):
|
||||
@overload # type: ignore[override]
|
||||
def __getitem__(self, i: slice) -> bytes: ...
|
||||
@overload # type: ignore[override]
|
||||
@overload
|
||||
def __getitem__(self, i: int) -> bytes: ...
|
||||
@overload # type: ignore[override]
|
||||
def __setitem__(self, i: slice, value: bytes) -> None: ...
|
||||
@overload # type: ignore[override]
|
||||
def __setitem__(self, i: int, value: bytes) -> None: ... # type: ignore[override]
|
||||
@overload
|
||||
def __setitem__(self, i: int, value: bytes) -> None: ...
|
||||
def __getslice__(self, start: int, stop: int) -> bytes: ... # type: ignore[override]
|
||||
def __setslice__(self, start: int, stop: int, values: bytes) -> None: ... # type: ignore[override]
|
||||
|
||||
|
||||
+1
-1
@@ -84,7 +84,7 @@ class Pdb(Bdb, Cmd):
|
||||
def _runscript(self, filename: str) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
def completedefault(self, text: str, line: str, begidx: int, endidx: int) -> list[str]: ... # type: ignore[override]
|
||||
def completedefault(self, text: str, line: str, begidx: int, endidx: int) -> list[str]: ...
|
||||
|
||||
def do_commands(self, arg: str) -> bool | None: ...
|
||||
def do_break(self, arg: str, temporary: bool = ...) -> bool | None: ...
|
||||
|
||||
+11
-7
@@ -74,7 +74,7 @@ class Match(Generic[AnyStr]):
|
||||
@overload
|
||||
def expand(self: Match[str], template: str) -> str: ...
|
||||
@overload
|
||||
def expand(self: Match[bytes], template: ReadableBuffer) -> bytes: ... # type: ignore[overload-overlap]
|
||||
def expand(self: Match[bytes], template: ReadableBuffer) -> bytes: ...
|
||||
@overload
|
||||
def expand(self, template: AnyStr) -> AnyStr: ...
|
||||
# group() returns "AnyStr" or "AnyStr | None", depending on the pattern.
|
||||
@@ -124,19 +124,21 @@ class Pattern(Generic[AnyStr]):
|
||||
@overload
|
||||
def search(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> Match[str] | None: ...
|
||||
@overload
|
||||
def search(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> Match[bytes] | None: ... # type: ignore[overload-overlap]
|
||||
def search(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> Match[bytes] | None: ...
|
||||
@overload
|
||||
def search(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> Match[AnyStr] | None: ...
|
||||
@overload
|
||||
def match(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> Match[str] | None: ...
|
||||
@overload
|
||||
def match(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> Match[bytes] | None: ... # type: ignore[overload-overlap]
|
||||
def match(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> Match[bytes] | None: ...
|
||||
@overload
|
||||
def match(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> Match[AnyStr] | None: ...
|
||||
@overload
|
||||
def fullmatch(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> Match[str] | None: ...
|
||||
@overload
|
||||
def fullmatch(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> Match[bytes] | None: ... # type: ignore[overload-overlap]
|
||||
def fullmatch(
|
||||
self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize
|
||||
) -> Match[bytes] | None: ...
|
||||
@overload
|
||||
def fullmatch(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> Match[AnyStr] | None: ...
|
||||
@overload
|
||||
@@ -155,13 +157,15 @@ class Pattern(Generic[AnyStr]):
|
||||
@overload
|
||||
def finditer(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> Iterator[Match[str]]: ...
|
||||
@overload
|
||||
def finditer(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> Iterator[Match[bytes]]: ... # type: ignore[overload-overlap]
|
||||
def finditer(
|
||||
self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize
|
||||
) -> Iterator[Match[bytes]]: ...
|
||||
@overload
|
||||
def finditer(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> Iterator[Match[AnyStr]]: ...
|
||||
@overload
|
||||
def sub(self: Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = 0) -> str: ...
|
||||
@overload
|
||||
def sub( # type: ignore[overload-overlap]
|
||||
def sub(
|
||||
self: Pattern[bytes],
|
||||
repl: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer],
|
||||
string: ReadableBuffer,
|
||||
@@ -172,7 +176,7 @@ class Pattern(Generic[AnyStr]):
|
||||
@overload
|
||||
def subn(self: Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = 0) -> tuple[str, int]: ...
|
||||
@overload
|
||||
def subn( # type: ignore[overload-overlap]
|
||||
def subn(
|
||||
self: Pattern[bytes],
|
||||
repl: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer],
|
||||
string: ReadableBuffer,
|
||||
|
||||
+2
-2
@@ -463,7 +463,7 @@ class TemporaryDirectory(Generic[AnyStr]):
|
||||
|
||||
# The overloads overlap, but they should still work fine.
|
||||
@overload
|
||||
def mkstemp( # type: ignore[overload-overlap]
|
||||
def mkstemp(
|
||||
suffix: str | None = None, prefix: str | None = None, dir: StrPath | None = None, text: bool = False
|
||||
) -> tuple[int, str]: ...
|
||||
@overload
|
||||
@@ -473,7 +473,7 @@ def mkstemp(
|
||||
|
||||
# The overloads overlap, but they should still work fine.
|
||||
@overload
|
||||
def mkdtemp(suffix: str | None = None, prefix: str | None = None, dir: StrPath | None = None) -> str: ... # type: ignore[overload-overlap]
|
||||
def mkdtemp(suffix: str | None = None, prefix: str | None = None, dir: StrPath | None = None) -> str: ...
|
||||
@overload
|
||||
def mkdtemp(suffix: bytes | None = None, prefix: bytes | None = None, dir: BytesPath | None = None) -> bytes: ...
|
||||
def mktemp(suffix: str = "", prefix: str = "tmp", dir: StrPath | None = None) -> str: ...
|
||||
|
||||
@@ -3564,7 +3564,7 @@ class Spinbox(Widget, XView):
|
||||
def scan_dragto(self, x): ...
|
||||
def selection(self, *args) -> tuple[int, ...]: ...
|
||||
def selection_adjust(self, index): ...
|
||||
def selection_clear(self): ...
|
||||
def selection_clear(self): ... # type: ignore[override]
|
||||
def selection_element(self, element: Incomplete | None = None): ...
|
||||
def selection_from(self, index: int) -> None: ...
|
||||
def selection_present(self) -> None: ...
|
||||
|
||||
@@ -1040,7 +1040,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
@overload
|
||||
def heading(self, column: str | int, option: str) -> Any: ...
|
||||
@overload
|
||||
def heading(self, column: str | int, option: None = None) -> _TreeviewHeaderDict: ... # type: ignore[overload-overlap]
|
||||
def heading(self, column: str | int, option: None = None) -> _TreeviewHeaderDict: ...
|
||||
@overload
|
||||
def heading(
|
||||
self,
|
||||
@@ -1052,7 +1052,8 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
anchor: tkinter._Anchor = ...,
|
||||
command: str | Callable[[], object] = ...,
|
||||
) -> None: ...
|
||||
def identify(self, component, x, y): ... # Internal Method. Leave untyped
|
||||
# Internal Method. Leave untyped:
|
||||
def identify(self, component, x, y): ... # type: ignore[override]
|
||||
def identify_row(self, y: int) -> str: ...
|
||||
def identify_column(self, x: int) -> str: ...
|
||||
def identify_region(self, x: int, y: int) -> Literal["heading", "separator", "tree", "cell", "nothing"]: ...
|
||||
@@ -1084,7 +1085,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
@overload
|
||||
def item(self, item: str | int, option: str) -> Any: ...
|
||||
@overload
|
||||
def item(self, item: str | int, option: None = None) -> _TreeviewItemDict: ... # type: ignore[overload-overlap]
|
||||
def item(self, item: str | int, option: None = None) -> _TreeviewItemDict: ...
|
||||
@overload
|
||||
def item(
|
||||
self,
|
||||
|
||||
+6
-6
@@ -338,7 +338,7 @@ class TPen:
|
||||
def isvisible(self) -> bool: ...
|
||||
# Note: signatures 1 and 2 overlap unsafely when no arguments are provided
|
||||
@overload
|
||||
def pen(self) -> _PenState: ... # type: ignore[overload-overlap]
|
||||
def pen(self) -> _PenState: ...
|
||||
@overload
|
||||
def pen(
|
||||
self,
|
||||
@@ -384,7 +384,7 @@ class RawTurtle(TPen, TNavigator):
|
||||
def shape(self, name: str) -> None: ...
|
||||
# Unsafely overlaps when no arguments are provided
|
||||
@overload
|
||||
def shapesize(self) -> tuple[float, float, float]: ... # type: ignore[overload-overlap]
|
||||
def shapesize(self) -> tuple[float, float, float]: ...
|
||||
@overload
|
||||
def shapesize(
|
||||
self, stretch_wid: float | None = None, stretch_len: float | None = None, outline: float | None = None
|
||||
@@ -395,7 +395,7 @@ class RawTurtle(TPen, TNavigator):
|
||||
def shearfactor(self, shear: float) -> None: ...
|
||||
# Unsafely overlaps when no arguments are provided
|
||||
@overload
|
||||
def shapetransform(self) -> tuple[float, float, float, float]: ... # type: ignore[overload-overlap]
|
||||
def shapetransform(self) -> tuple[float, float, float, float]: ...
|
||||
@overload
|
||||
def shapetransform(
|
||||
self, t11: float | None = None, t12: float | None = None, t21: float | None = None, t22: float | None = None
|
||||
@@ -622,7 +622,7 @@ def isvisible() -> bool: ...
|
||||
|
||||
# Note: signatures 1 and 2 overlap unsafely when no arguments are provided
|
||||
@overload
|
||||
def pen() -> _PenState: ... # type: ignore[overload-overlap]
|
||||
def pen() -> _PenState: ...
|
||||
@overload
|
||||
def pen(
|
||||
pen: _PenState | None = None,
|
||||
@@ -661,7 +661,7 @@ if sys.version_info >= (3, 12):
|
||||
|
||||
# Unsafely overlaps when no arguments are provided
|
||||
@overload
|
||||
def shapesize() -> tuple[float, float, float]: ... # type: ignore[overload-overlap]
|
||||
def shapesize() -> tuple[float, float, float]: ...
|
||||
@overload
|
||||
def shapesize(stretch_wid: float | None = None, stretch_len: float | None = None, outline: float | None = None) -> None: ...
|
||||
@overload
|
||||
@@ -671,7 +671,7 @@ def shearfactor(shear: float) -> None: ...
|
||||
|
||||
# Unsafely overlaps when no arguments are provided
|
||||
@overload
|
||||
def shapetransform() -> tuple[float, float, float, float]: ... # type: ignore[overload-overlap]
|
||||
def shapetransform() -> tuple[float, float, float, float]: ...
|
||||
@overload
|
||||
def shapetransform(
|
||||
t11: float | None = None, t12: float | None = None, t21: float | None = None, t22: float | None = None
|
||||
|
||||
+3
-3
@@ -305,9 +305,9 @@ class MappingProxyType(Mapping[_KT, _VT_co]):
|
||||
def values(self) -> ValuesView[_VT_co]: ...
|
||||
def items(self) -> ItemsView[_KT, _VT_co]: ...
|
||||
@overload
|
||||
def get(self, key: _KT, /) -> _VT_co | None: ... # type: ignore[override]
|
||||
def get(self, key: _KT, /) -> _VT_co | None: ...
|
||||
@overload
|
||||
def get(self, key: _KT, default: _VT_co | _T2, /) -> _VT_co | _T2: ... # type: ignore[override]
|
||||
def get(self, key: _KT, default: _VT_co | _T2, /) -> _VT_co | _T2: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
|
||||
def __reversed__(self) -> Iterator[_KT]: ...
|
||||
@@ -583,7 +583,7 @@ _P = ParamSpec("_P")
|
||||
|
||||
# it's not really an Awaitable, but can be used in an await expression. Real type: Generator & Awaitable
|
||||
@overload
|
||||
def coroutine(func: Callable[_P, Generator[Any, Any, _R]]) -> Callable[_P, Awaitable[_R]]: ... # type: ignore[overload-overlap]
|
||||
def coroutine(func: Callable[_P, Generator[Any, Any, _R]]) -> Callable[_P, Awaitable[_R]]: ...
|
||||
@overload
|
||||
def coroutine(func: _Fn) -> _Fn: ...
|
||||
|
||||
|
||||
@@ -299,7 +299,7 @@ class _patcher:
|
||||
# Ideally we'd be able to add an overload for it so that the return type is _patch[MagicMock],
|
||||
# but that's impossible with the current type system.
|
||||
@overload
|
||||
def __call__( # type: ignore[overload-overlap]
|
||||
def __call__(
|
||||
self,
|
||||
target: str,
|
||||
new: _T,
|
||||
|
||||
@@ -198,13 +198,13 @@ else:
|
||||
|
||||
# Requires an iterable of length 6
|
||||
@overload
|
||||
def urlunparse(components: Iterable[None]) -> Literal[b""]: ...
|
||||
def urlunparse(components: Iterable[None]) -> Literal[b""]: ... # type: ignore[overload-overlap]
|
||||
@overload
|
||||
def urlunparse(components: Iterable[AnyStr | None]) -> AnyStr: ...
|
||||
|
||||
# Requires an iterable of length 5
|
||||
@overload
|
||||
def urlunsplit(components: Iterable[None]) -> Literal[b""]: ...
|
||||
def urlunsplit(components: Iterable[None]) -> Literal[b""]: ... # type: ignore[overload-overlap]
|
||||
@overload
|
||||
def urlunsplit(components: Iterable[AnyStr | None]) -> AnyStr: ...
|
||||
def unwrap(url: str) -> str: ...
|
||||
|
||||
@@ -6,7 +6,7 @@ from typing_extensions import Self
|
||||
_T = TypeVar("_T")
|
||||
|
||||
@overload
|
||||
def ord_(dta: str) -> int: ... # type: ignore[overload-overlap]
|
||||
def ord_(dta: str) -> int: ...
|
||||
@overload
|
||||
def ord_(dta: _T) -> _T: ...
|
||||
def make_string(seq: str | list[int]) -> str: ...
|
||||
|
||||
@@ -60,7 +60,7 @@ def serialize_option(options_dict: _Options, key: str, upper: bool = False) -> N
|
||||
@overload
|
||||
def ensure_iterable(inst: str) -> list[str]: ... # type: ignore[overload-overlap]
|
||||
@overload
|
||||
def ensure_iterable(inst: _IterableT) -> _IterableT: ...
|
||||
def ensure_iterable(inst: _IterableT) -> _IterableT: ... # type: ignore[overload-overlap]
|
||||
@overload
|
||||
def ensure_iterable(inst: _T) -> list[_T]: ...
|
||||
def sanitize_regex_param(param: str | list[str]) -> list[str]: ...
|
||||
|
||||
@@ -40,7 +40,7 @@ class HmacAuthV3HTTPHandler(AuthHandler, HmacKeys):
|
||||
def headers_to_sign(self, http_request): ...
|
||||
def canonical_headers(self, headers_to_sign): ...
|
||||
def string_to_sign(self, http_request): ...
|
||||
def add_auth(self, req, **kwargs): ...
|
||||
def add_auth(self, req, **kwargs): ... # type: ignore[override]
|
||||
|
||||
class HmacAuthV4Handler(AuthHandler, HmacKeys):
|
||||
capability: Any
|
||||
@@ -65,7 +65,7 @@ class HmacAuthV4Handler(AuthHandler, HmacKeys):
|
||||
def credential_scope(self, http_request): ...
|
||||
def string_to_sign(self, http_request, canonical_request): ...
|
||||
def signature(self, http_request, string_to_sign): ...
|
||||
def add_auth(self, req, **kwargs): ...
|
||||
def add_auth(self, req, **kwargs): ... # type: ignore[override]
|
||||
|
||||
class S3HmacAuthV4Handler(HmacAuthV4Handler, AuthHandler):
|
||||
capability: Any
|
||||
@@ -80,7 +80,7 @@ class S3HmacAuthV4Handler(HmacAuthV4Handler, AuthHandler):
|
||||
def determine_service_name(self, host): ...
|
||||
def mangle_path_and_params(self, req): ...
|
||||
def payload(self, http_request): ...
|
||||
def add_auth(self, req, **kwargs): ...
|
||||
def add_auth(self, req, **kwargs): ... # type: ignore[override]
|
||||
def presign(self, req, expires, iso_date: Incomplete | None = None): ...
|
||||
|
||||
class STSAnonHandler(AuthHandler):
|
||||
@@ -105,7 +105,7 @@ class QuerySignatureV2AuthHandler(QuerySignatureHelper, AuthHandler):
|
||||
|
||||
class POSTPathQSV2AuthHandler(QuerySignatureV2AuthHandler, AuthHandler):
|
||||
capability: Any
|
||||
def add_auth(self, req, **kwargs): ...
|
||||
def add_auth(self, req, **kwargs): ... # type: ignore[override]
|
||||
|
||||
def get_auth_handler(host, config, provider, requested_capability: Incomplete | None = None): ...
|
||||
def detect_potential_sigv4(func): ...
|
||||
|
||||
@@ -8,6 +8,6 @@ class Secret(Model):
|
||||
|
||||
class SecretCollection(Collection[Secret]):
|
||||
model: type[Secret]
|
||||
def create(self, **kwargs): ...
|
||||
def create(self, **kwargs): ... # type: ignore[override]
|
||||
def get(self, secret_id): ...
|
||||
def list(self, **kwargs): ...
|
||||
|
||||
@@ -15,9 +15,9 @@ class SSHSocket(socket.socket):
|
||||
def __init__(self, host) -> None: ...
|
||||
def connect(self, **kwargs) -> None: ... # type:ignore[override]
|
||||
def sendall(self, data) -> None: ... # type:ignore[override]
|
||||
def send(self, data): ...
|
||||
def recv(self, n): ...
|
||||
def makefile(self, mode): ...
|
||||
def send(self, data): ... # type:ignore[override]
|
||||
def recv(self, n): ... # type:ignore[override]
|
||||
def makefile(self, mode): ... # type:ignore[override]
|
||||
def close(self) -> None: ...
|
||||
|
||||
class SSHConnection(urllib3.connection.HTTPConnection):
|
||||
|
||||
@@ -14,4 +14,6 @@ def first(iterable: Iterable[_T], default: _S) -> _T | _S: ...
|
||||
@overload
|
||||
def first(iterable: Iterable[_T], default: _S, key: Callable[[_T], Any] | None) -> _T | _S: ...
|
||||
@overload
|
||||
def first(iterable: Iterable[_T], default: None, key: Callable[[_T], Any] | None) -> _T | None: ...
|
||||
@overload
|
||||
def first(iterable: Iterable[_T], *, key: Callable[[_T], Any] | None) -> _T | None: ...
|
||||
|
||||
@@ -43,6 +43,8 @@ class Timeout(BaseException):
|
||||
# when timeout_value is provided we unfortunately get no type checking on *args, **kwargs, because
|
||||
# ParamSpec does not allow mixing in additional keyword arguments
|
||||
@overload
|
||||
def with_timeout(seconds: float | None, function: Callable[..., _T1], *args: Any, timeout_value: _T2, **kwds: Any) -> _T1 | _T2: ... # type: ignore[misc]
|
||||
def with_timeout(
|
||||
seconds: float | None, function: Callable[..., _T1], *args: Any, timeout_value: _T2, **kwds: Any
|
||||
) -> _T1 | _T2: ...
|
||||
@overload
|
||||
def with_timeout(seconds: float | None, function: Callable[_P, _T], *args: _P.args, **kwds: _P.kwargs) -> _T: ...
|
||||
|
||||
@@ -34,12 +34,12 @@ class _GlobalCacheSetBatch(_GlobalCacheBatch):
|
||||
def done_callback(self, cache_call) -> None: ...
|
||||
def add(self, key, value): ...
|
||||
def make_call(self): ...
|
||||
def future_info(self, key, value): ...
|
||||
def future_info(self, key, value): ... # type:ignore[override]
|
||||
|
||||
class _GlobalCacheSetIfNotExistsBatch(_GlobalCacheSetBatch):
|
||||
def add(self, key, value): ...
|
||||
def make_call(self): ...
|
||||
def future_info(self, key, value): ...
|
||||
def future_info(self, key, value): ... # type:ignore[override]
|
||||
|
||||
global_delete: Any
|
||||
|
||||
@@ -55,7 +55,7 @@ global_watch: Any
|
||||
|
||||
class _GlobalCacheWatchBatch(_GlobalCacheDeleteBatch):
|
||||
def make_call(self): ...
|
||||
def future_info(self, key, value): ...
|
||||
def future_info(self, key, value): ... # type:ignore[override]
|
||||
|
||||
def global_unwatch(key): ...
|
||||
|
||||
@@ -67,7 +67,7 @@ global_compare_and_swap: Any
|
||||
|
||||
class _GlobalCacheCompareAndSwapBatch(_GlobalCacheSetBatch):
|
||||
def make_call(self): ...
|
||||
def future_info(self, key, value): ...
|
||||
def future_info(self, key, value): ... # type:ignore[override]
|
||||
|
||||
def is_locked_value(value): ...
|
||||
def global_cache_key(key): ...
|
||||
|
||||
@@ -15,7 +15,7 @@ class BoundMethodDispatcher(Mapping[Any, Any]):
|
||||
dispatcher: Any
|
||||
def __init__(self, instance, dispatcher) -> None: ...
|
||||
def __getitem__(self, key): ...
|
||||
def get(self, key, default): ...
|
||||
def get(self, key, default): ... # type: ignore[override]
|
||||
def __iter__(self): ...
|
||||
def __len__(self) -> int: ...
|
||||
def __contains__(self, key): ...
|
||||
|
||||
@@ -8,10 +8,10 @@ DEFAULT_ENCODING: str
|
||||
def from_unicode(value: str | bytes, encoding: str = "utf-8") -> bytes: ...
|
||||
def to_unicode(value: str | bytes, encoding: str = "utf-8") -> str: ...
|
||||
@overload
|
||||
def data_encode(data: str, encoding: str = ...) -> bytes: ... # type: ignore[misc]
|
||||
def data_encode(data: str, encoding: str = ...) -> bytes: ...
|
||||
@overload
|
||||
def data_encode(data: dict[Any, Any], encoding: str = ...) -> dict[Any, Any]: ...
|
||||
@overload
|
||||
def data_encode(data: list[Any] | tuple[Any, ...], encoding: str = ...) -> list[Any]: ... # type: ignore[misc]
|
||||
def data_encode(data: list[Any] | tuple[Any, ...], encoding: str = ...) -> list[Any]: ...
|
||||
@overload
|
||||
def data_encode(data: _T, encoding: str = ...) -> _T: ...
|
||||
|
||||
@@ -72,7 +72,7 @@ class OutEdgeView(AbstractSet[Incomplete], Mapping[Incomplete, Incomplete], Gene
|
||||
def __contains__(self, e: _Edge[_Node]) -> bool: ... # type: ignore[override]
|
||||
def __getitem__(self, e: _Edge[_Node]) -> dict[str, Any]: ...
|
||||
@overload
|
||||
def __call__(self, nbunch: None = None, data: Literal[False] = False, *, default: Unused = None) -> Self: ...
|
||||
def __call__(self, nbunch: None = None, data: Literal[False] = False, *, default: Unused = None) -> Self: ... # type: ignore[overload-overlap]
|
||||
@overload
|
||||
def __call__(
|
||||
self, nbunch: _Node | Iterable[_Node], data: Literal[False] = False, *, default: None = None
|
||||
|
||||
@@ -8,4 +8,4 @@ log: Any
|
||||
class AuthorizationCodeGrant(GrantTypeBase):
|
||||
proxy_target: Any
|
||||
def __init__(self, request_validator: Incomplete | None = None, **kwargs) -> None: ...
|
||||
def add_id_token(self, token, token_handler, request): ...
|
||||
def add_id_token(self, token, token_handler, request): ... # type: ignore[override]
|
||||
|
||||
@@ -12,5 +12,5 @@ class HybridGrant(GrantTypeBase):
|
||||
request_validator: Any
|
||||
proxy_target: Any
|
||||
def __init__(self, request_validator: Incomplete | None = None, **kwargs) -> None: ...
|
||||
def add_id_token(self, token, token_handler, request): ...
|
||||
def add_id_token(self, token, token_handler, request): ... # type: ignore[override]
|
||||
def openid_authorization_validator(self, request): ...
|
||||
|
||||
@@ -8,5 +8,5 @@ log: Any
|
||||
class ImplicitGrant(GrantTypeBase):
|
||||
proxy_target: Any
|
||||
def __init__(self, request_validator: Incomplete | None = None, **kwargs) -> None: ...
|
||||
def add_id_token(self, token, token_handler, request): ...
|
||||
def add_id_token(self, token, token_handler, request): ... # type: ignore[override]
|
||||
def openid_authorization_validator(self, request): ...
|
||||
|
||||
@@ -7,4 +7,4 @@ log: Incomplete
|
||||
class RefreshTokenGrant(GrantTypeBase):
|
||||
proxy_target: Incomplete
|
||||
def __init__(self, request_validator: Incomplete | None = None, **kwargs) -> None: ...
|
||||
def add_id_token(self, token, token_handler, request): ...
|
||||
def add_id_token(self, token, token_handler, request): ... # type: ignore[override]
|
||||
|
||||
@@ -166,9 +166,9 @@ class OleDirectoryEntry(Generic[AnyStr]):
|
||||
def build_storage_tree(self) -> None: ...
|
||||
def append_kids(self, child_sid: int) -> None: ...
|
||||
def __eq__(self, other: OleDirectoryEntry[AnyStr]) -> bool: ... # type: ignore[override]
|
||||
def __lt__(self, other: OleDirectoryEntry[AnyStr]) -> bool: ... # type: ignore[override]
|
||||
def __lt__(self, other: OleDirectoryEntry[AnyStr]) -> bool: ...
|
||||
def __ne__(self, other: OleDirectoryEntry[AnyStr]) -> bool: ... # type: ignore[override]
|
||||
def __le__(self, other: OleDirectoryEntry[AnyStr]) -> bool: ... # type: ignore[override]
|
||||
def __le__(self, other: OleDirectoryEntry[AnyStr]) -> bool: ...
|
||||
def dump(self, tab: int = 0) -> None: ...
|
||||
def getmtime(self) -> datetime.datetime | None: ...
|
||||
def getctime(self) -> datetime.datetime | None: ...
|
||||
|
||||
@@ -37,7 +37,7 @@ class Nested(Descriptor[_T]):
|
||||
def __set__(self, instance: Serialisable | Strict, value: _HasTagAndGet[_T] | _T) -> None: ...
|
||||
def from_tree(self, node: _HasGet[_T]) -> _T: ...
|
||||
@overload
|
||||
def to_tree(self, tagname: Unused = None, value: None = None, namespace: Unused = None) -> None: ... # type: ignore[overload-overlap]
|
||||
def to_tree(self, tagname: Unused = None, value: None = None, namespace: Unused = None) -> None: ...
|
||||
@overload
|
||||
def to_tree(self, tagname: str, value: object, namespace: str | None = None) -> Element: ...
|
||||
|
||||
@@ -155,7 +155,7 @@ class NestedText(NestedValue[_T, _N]):
|
||||
def __set__(self: NestedText[_T, Literal[True]], instance: Serialisable | Strict, value: _T | int | Any | None) -> None: ...
|
||||
def from_tree(self, node: _HasText) -> str: ... # type: ignore[override]
|
||||
@overload
|
||||
def to_tree(self, tagname: Unused = None, value: None = None, namespace: Unused = None) -> None: ... # type: ignore[overload-overlap]
|
||||
def to_tree(self, tagname: Unused = None, value: None = None, namespace: Unused = None) -> None: ...
|
||||
@overload
|
||||
def to_tree(self, tagname: str, value: object, namespace: str | None = None) -> Element: ...
|
||||
|
||||
@@ -271,8 +271,6 @@ class EmptyTag(Nested[bool], Bool[_N]): # type: ignore[misc]
|
||||
def __set__(self, instance: Serialisable | Strict, value: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool) -> None: ...
|
||||
def from_tree(self, node: Unused) -> Literal[True]: ...
|
||||
@overload
|
||||
def to_tree( # type: ignore[overload-overlap]
|
||||
self, tagname: Unused = None, value: None = None, namespace: Unused = None
|
||||
) -> None: ...
|
||||
def to_tree(self, tagname: Unused = None, value: None = None, namespace: Unused = None) -> None: ...
|
||||
@overload
|
||||
def to_tree(self, tagname: str, value: object, namespace: str | None = None) -> Element: ...
|
||||
|
||||
@@ -44,7 +44,7 @@ class NamedStyle(Serialisable):
|
||||
def as_name(self) -> _NamedCellStyle: ...
|
||||
|
||||
class NamedStyleList(list[NamedStyle]):
|
||||
def __init__(self, iterable: Iterable[NamedStyle] = ()) -> None: ... # type: ignore[override]
|
||||
def __init__(self, iterable: Iterable[NamedStyle] = ()) -> None: ...
|
||||
@property
|
||||
def names(self) -> list[str]: ...
|
||||
def __getitem__(self, key: int | str) -> NamedStyle: ... # type: ignore[override]
|
||||
|
||||
@@ -77,7 +77,7 @@ def fromstring(text: str | ReadableBuffer, parser: XMLParser | None = None) -> E
|
||||
# from lxml.etree import fromstring
|
||||
# But made partial, removing parser arg
|
||||
@overload
|
||||
def fromstring(text: str | bytes, *, base_url: str | bytes = ...) -> _lxml_Element: ... # type: ignore[overload-overlap]
|
||||
def fromstring(text: str | bytes, *, base_url: str | bytes = ...) -> _lxml_Element: ...
|
||||
|
||||
# from defusedxml.ElementTree import fromstring
|
||||
@overload
|
||||
|
||||
@@ -239,13 +239,13 @@ class ColumnBase(Node):
|
||||
def __invert__(self): ...
|
||||
__and__: Incomplete
|
||||
__or__: Incomplete
|
||||
__add__: Callable[[Self, Any], Expression]
|
||||
def __add__(self, rhs: Any) -> Expression: ...
|
||||
__sub__: Incomplete
|
||||
__mul__: Callable[[Self, Any], Expression]
|
||||
__div__: Callable[[Self, Any], Expression]
|
||||
__truediv__: Callable[[Self, Any], Expression]
|
||||
__xor__: Callable[[Self, Any], Expression]
|
||||
__radd__: Callable[[Self, Any], Expression]
|
||||
def __radd__(self, rhs: Any) -> Expression: ...
|
||||
__rsub__: Callable[[Self, Any], Expression]
|
||||
__rmul__: Callable[[Self, Any], Expression]
|
||||
__rdiv__: Callable[[Self, Any], Expression]
|
||||
|
||||
@@ -23,7 +23,7 @@ class PopenSpawn(SpawnBase[AnyStr]):
|
||||
preexec_fn: Callable[[], None] | None = None,
|
||||
) -> None: ...
|
||||
flag_eof: bool
|
||||
def read_nonblocking(self, size, timeout): ...
|
||||
def read_nonblocking(self, size, timeout): ... # type: ignore[override]
|
||||
def write(self, s) -> None: ...
|
||||
def writelines(self, sequence) -> None: ...
|
||||
def send(self, s): ...
|
||||
|
||||
@@ -22,7 +22,7 @@ def merge(rleObjs: list[_EncodedRLE], intersect: int = ...) -> _EncodedRLE: ...
|
||||
|
||||
# ignore an "overlapping overloads" error due to _NDArrayInt32 being an alias for `Incomplete` for now
|
||||
@overload
|
||||
def frPyObjects(pyobj: _NDArrayUInt32 | list[list[int]] | list[_EncodedRLE], h: int, w: int) -> list[_EncodedRLE]: ... # type: ignore[overload-overlap]
|
||||
def frPyObjects(pyobj: _NDArrayUInt32 | list[list[int]] | list[_EncodedRLE], h: int, w: int) -> list[_EncodedRLE]: ...
|
||||
@overload
|
||||
def frPyObjects(pyobj: list[int] | _EncodedRLE, h: int, w: int) -> _EncodedRLE: ...
|
||||
def encode(bimask: _NDArrayUInt8) -> _EncodedRLE: ...
|
||||
|
||||
@@ -17,7 +17,7 @@ class DebugStackFrame(gateways.DebugStackFrame):
|
||||
def GetThread(self) -> None: ...
|
||||
def GetCodeContext(self): ...
|
||||
def GetDescriptionString(self, fLong): ...
|
||||
def GetLanguageString(self, fLong): ...
|
||||
def GetLanguageString(self, fLong): ... # type: ignore[override]
|
||||
def GetDebugProperty(self): ...
|
||||
|
||||
class DebugStackFrameSniffer:
|
||||
|
||||
@@ -1023,7 +1023,7 @@ class SortedSetCommands(Generic[_StrType]):
|
||||
@overload
|
||||
def bzpopmin(self, keys: _Key | Iterable[_Key], timeout: float) -> tuple[_StrType, _StrType, float] | None: ...
|
||||
@overload
|
||||
def zrange(
|
||||
def zrange( # type: ignore[overload-overlap]
|
||||
self,
|
||||
name: _Key,
|
||||
start: int,
|
||||
@@ -1037,7 +1037,7 @@ class SortedSetCommands(Generic[_StrType]):
|
||||
num: int | None = None,
|
||||
) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
|
||||
@overload
|
||||
def zrange(
|
||||
def zrange( # type: ignore[overload-overlap]
|
||||
self,
|
||||
name: _Key,
|
||||
start: int,
|
||||
@@ -1051,7 +1051,7 @@ class SortedSetCommands(Generic[_StrType]):
|
||||
num: int | None = None,
|
||||
) -> list[tuple[_StrType, float]]: ...
|
||||
@overload
|
||||
def zrange(
|
||||
def zrange( # type: ignore[overload-overlap]
|
||||
self,
|
||||
name: _Key,
|
||||
start: int,
|
||||
@@ -1065,7 +1065,7 @@ class SortedSetCommands(Generic[_StrType]):
|
||||
num: int | None = None,
|
||||
) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
|
||||
@overload
|
||||
def zrange(
|
||||
def zrange( # type: ignore[overload-overlap]
|
||||
self,
|
||||
name: _Key,
|
||||
start: int,
|
||||
@@ -1102,7 +1102,9 @@ class SortedSetCommands(Generic[_StrType]):
|
||||
score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn],
|
||||
) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
|
||||
@overload
|
||||
def zrevrange(self, name: _Key, start: int, end: int, withscores: Literal[True]) -> list[tuple[_StrType, float]]: ...
|
||||
def zrevrange( # type: ignore[overload-overlap]
|
||||
self, name: _Key, start: int, end: int, withscores: Literal[True]
|
||||
) -> list[tuple[_StrType, float]]: ...
|
||||
@overload
|
||||
def zrevrange(
|
||||
self, name: _Key, start: int, end: int, withscores: bool = False, score_cast_func: Callable[[Any], Any] = ...
|
||||
@@ -1126,7 +1128,7 @@ class SortedSetCommands(Generic[_StrType]):
|
||||
self, name: _Key, max: _Value, min: _Value, start: int | None = None, num: int | None = None
|
||||
) -> list[_StrType]: ...
|
||||
@overload
|
||||
def zrangebyscore(
|
||||
def zrangebyscore( # type: ignore[overload-overlap]
|
||||
self,
|
||||
name: _Key,
|
||||
min: _Value,
|
||||
@@ -1138,7 +1140,7 @@ class SortedSetCommands(Generic[_StrType]):
|
||||
score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn],
|
||||
) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
|
||||
@overload
|
||||
def zrangebyscore(
|
||||
def zrangebyscore( # type: ignore[overload-overlap]
|
||||
self, name: _Key, min: _Value, max: _Value, start: int | None = None, num: int | None = None, *, withscores: Literal[True]
|
||||
) -> list[tuple[_StrType, float]]: ...
|
||||
@overload
|
||||
@@ -1153,7 +1155,7 @@ class SortedSetCommands(Generic[_StrType]):
|
||||
score_cast_func: Callable[[_StrType], Any] = ...,
|
||||
) -> list[_StrType]: ...
|
||||
@overload
|
||||
def zrevrangebyscore(
|
||||
def zrevrangebyscore( # type: ignore[overload-overlap]
|
||||
self,
|
||||
name: _Key,
|
||||
max: _Value,
|
||||
@@ -1165,7 +1167,7 @@ class SortedSetCommands(Generic[_StrType]):
|
||||
score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn],
|
||||
) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
|
||||
@overload
|
||||
def zrevrangebyscore(
|
||||
def zrevrangebyscore( # type: ignore[overload-overlap]
|
||||
self, name: _Key, max: _Value, min: _Value, start: int | None = None, num: int | None = None, *, withscores: Literal[True]
|
||||
) -> list[tuple[_StrType, float]]: ...
|
||||
@overload
|
||||
@@ -1224,7 +1226,7 @@ class AsyncSortedSetCommands(Generic[_StrType]):
|
||||
@overload
|
||||
async def bzpopmin(self, keys: _Key | Iterable[_Key], timeout: float) -> tuple[_StrType, _StrType, float] | None: ...
|
||||
@overload
|
||||
async def zrange(
|
||||
async def zrange( # type: ignore[overload-overlap]
|
||||
self,
|
||||
name: _Key,
|
||||
start: int,
|
||||
@@ -1238,7 +1240,7 @@ class AsyncSortedSetCommands(Generic[_StrType]):
|
||||
num: int | None = None,
|
||||
) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
|
||||
@overload
|
||||
async def zrange(
|
||||
async def zrange( # type: ignore[overload-overlap]
|
||||
self,
|
||||
name: _Key,
|
||||
start: int,
|
||||
@@ -1252,7 +1254,7 @@ class AsyncSortedSetCommands(Generic[_StrType]):
|
||||
num: int | None = None,
|
||||
) -> list[tuple[_StrType, float]]: ...
|
||||
@overload
|
||||
async def zrange(
|
||||
async def zrange( # type: ignore[overload-overlap]
|
||||
self,
|
||||
name: _Key,
|
||||
start: int,
|
||||
@@ -1267,7 +1269,7 @@ class AsyncSortedSetCommands(Generic[_StrType]):
|
||||
num: int | None = None,
|
||||
) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
|
||||
@overload
|
||||
async def zrange(
|
||||
async def zrange( # type: ignore[overload-overlap]
|
||||
self,
|
||||
name: _Key,
|
||||
start: int,
|
||||
@@ -1305,7 +1307,9 @@ class AsyncSortedSetCommands(Generic[_StrType]):
|
||||
score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn],
|
||||
) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
|
||||
@overload
|
||||
async def zrevrange(self, name: _Key, start: int, end: int, withscores: Literal[True]) -> list[tuple[_StrType, float]]: ...
|
||||
async def zrevrange( # type: ignore[overload-overlap]
|
||||
self, name: _Key, start: int, end: int, withscores: Literal[True]
|
||||
) -> list[tuple[_StrType, float]]: ...
|
||||
@overload
|
||||
async def zrevrange(
|
||||
self, name: _Key, start: int, end: int, withscores: bool = False, score_cast_func: Callable[[Any], Any] = ...
|
||||
@@ -1329,7 +1333,7 @@ class AsyncSortedSetCommands(Generic[_StrType]):
|
||||
self, name: _Key, max: _Value, min: _Value, start: int | None = None, num: int | None = None
|
||||
) -> list[_StrType]: ...
|
||||
@overload
|
||||
async def zrangebyscore(
|
||||
async def zrangebyscore( # type: ignore[overload-overlap]
|
||||
self,
|
||||
name: _Key,
|
||||
min: _Value,
|
||||
@@ -1341,7 +1345,7 @@ class AsyncSortedSetCommands(Generic[_StrType]):
|
||||
score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn],
|
||||
) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
|
||||
@overload
|
||||
async def zrangebyscore(
|
||||
async def zrangebyscore( # type: ignore[overload-overlap]
|
||||
self, name: _Key, min: _Value, max: _Value, start: int | None = None, num: int | None = None, *, withscores: Literal[True]
|
||||
) -> list[tuple[_StrType, float]]: ...
|
||||
@overload
|
||||
@@ -1356,7 +1360,7 @@ class AsyncSortedSetCommands(Generic[_StrType]):
|
||||
score_cast_func: Callable[[_StrType], Any] = ...,
|
||||
) -> list[_StrType]: ...
|
||||
@overload
|
||||
async def zrevrangebyscore(
|
||||
async def zrevrangebyscore( # type: ignore[overload-overlap]
|
||||
self,
|
||||
name: _Key,
|
||||
max: _Value,
|
||||
@@ -1368,7 +1372,7 @@ class AsyncSortedSetCommands(Generic[_StrType]):
|
||||
score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn],
|
||||
) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
|
||||
@overload
|
||||
async def zrevrangebyscore(
|
||||
async def zrevrangebyscore( # type: ignore[overload-overlap]
|
||||
self, name: _Key, max: _Value, min: _Value, start: int | None = None, num: int | None = None, *, withscores: Literal[True]
|
||||
) -> list[tuple[_StrType, float]]: ...
|
||||
@overload
|
||||
|
||||
@@ -48,7 +48,8 @@ class UntrustedAstTransformer(ast.NodeTransformer):
|
||||
def visit_Subscript(self, node): ...
|
||||
def visit_Assign(self, node): ...
|
||||
def visit_AugAssign(self, node): ...
|
||||
def visit_While(node): ...
|
||||
# Bug in `reportlab`'s source code:
|
||||
def visit_While(node): ... # type: ignore[override]
|
||||
def visit_ExceptHandler(self, node): ...
|
||||
def visit_With(self, node): ...
|
||||
def visit_FunctionDef(self, node): ...
|
||||
|
||||
@@ -124,7 +124,7 @@ class WorkingSet:
|
||||
def __iter__(self) -> Iterator[Distribution]: ...
|
||||
def add(self, dist: Distribution, entry: str | None = None, insert: bool = True, replace: bool = False) -> None: ...
|
||||
@overload
|
||||
def resolve( # type: ignore[overload-overlap]
|
||||
def resolve(
|
||||
self,
|
||||
requirements: Iterable[Requirement],
|
||||
env: Environment | None,
|
||||
@@ -133,7 +133,7 @@ class WorkingSet:
|
||||
extras: tuple[str, ...] | None = None,
|
||||
) -> list[_DistributionT]: ...
|
||||
@overload
|
||||
def resolve( # type: ignore[overload-overlap]
|
||||
def resolve(
|
||||
self,
|
||||
requirements: Iterable[Requirement],
|
||||
env: Environment | None = None,
|
||||
@@ -143,7 +143,7 @@ class WorkingSet:
|
||||
extras: tuple[str, ...] | None = None,
|
||||
) -> list[_DistributionT]: ...
|
||||
@overload
|
||||
def resolve( # type: ignore[overload-overlap]
|
||||
def resolve(
|
||||
self,
|
||||
requirements: Iterable[Requirement],
|
||||
env: Environment | None = None,
|
||||
@@ -152,7 +152,7 @@ class WorkingSet:
|
||||
extras: tuple[str, ...] | None = None,
|
||||
) -> list[Distribution]: ...
|
||||
@overload
|
||||
def find_plugins( # type: ignore[overload-overlap]
|
||||
def find_plugins(
|
||||
self,
|
||||
plugin_env: Environment,
|
||||
full_env: Environment | None,
|
||||
@@ -160,7 +160,7 @@ class WorkingSet:
|
||||
fallback: bool = True,
|
||||
) -> tuple[list[_DistributionT], dict[Distribution, Exception]]: ...
|
||||
@overload
|
||||
def find_plugins( # type: ignore[overload-overlap]
|
||||
def find_plugins(
|
||||
self,
|
||||
plugin_env: Environment,
|
||||
full_env: Environment | None = None,
|
||||
@@ -205,7 +205,7 @@ class Environment:
|
||||
replace_conflicting: bool = False,
|
||||
) -> Distribution | None: ...
|
||||
@overload
|
||||
def obtain(self, requirement: Requirement, installer: _InstallerTypeT[_DistributionT]) -> _DistributionT: ... # type: ignore[overload-overlap]
|
||||
def obtain(self, requirement: Requirement, installer: _InstallerTypeT[_DistributionT]) -> _DistributionT: ...
|
||||
@overload
|
||||
def obtain(self, requirement: Requirement, installer: Callable[[Requirement], None] | None = None) -> None: ...
|
||||
@overload
|
||||
|
||||
@@ -79,7 +79,7 @@ class Command(_Command):
|
||||
# Any: Dynamic command subclass attributes
|
||||
def __init__(self, dist: Distribution, **kw: Any) -> None: ...
|
||||
def ensure_string_list(self, option: str) -> None: ...
|
||||
@overload # type: ignore[override] # Extra **kw param
|
||||
@overload # Extra **kw param
|
||||
def reinitialize_command(self, command: str, reinit_subcommands: bool = False, **kw) -> _Command: ...
|
||||
@overload
|
||||
def reinitialize_command(self, command: _CommandT, reinit_subcommands: bool = False, **kw) -> _CommandT: ...
|
||||
|
||||
Reference in New Issue
Block a user