mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-23 03:22:32 +08:00
A new shade of Black (#11362)
This commit is contained in:
10
.flake8
10
.flake8
@@ -14,10 +14,10 @@
|
||||
# E302 expected 2 blank lines
|
||||
# E305 expected 2 blank lines
|
||||
# E501 line too long
|
||||
# E701 Multiple statements on one line (colon) -- disallows "..." on the same line
|
||||
|
||||
# Some rules are considered irrelevant to stub files:
|
||||
# B All flake8-bugbear rules are .py-specific
|
||||
# E701 multiple statements on one line (colon) -- disallows "..." on the same line
|
||||
# F401 imported but unused -- does not recognize re-exports
|
||||
# https://github.com/PyCQA/pyflakes/issues/474
|
||||
|
||||
@@ -27,18 +27,18 @@
|
||||
# F405 defined from star imports
|
||||
|
||||
[flake8]
|
||||
extend-ignore = A, D, N8, SIM, RST, TYP, E301, E302, E305, E501
|
||||
extend-ignore = A, D, N8, SIM, RST, TYP, E301, E302, E305, E501, E701
|
||||
per-file-ignores =
|
||||
*.py: E203
|
||||
*.pyi: B, E701, E741, F401, F403, F405
|
||||
*.pyi: B, E741, F401, F403, F405
|
||||
# Since typing.pyi defines "overload" this is not recognized by Flake8 as typing.overload.
|
||||
# Unfortunately, Flake8 does not allow to "noqa" just a specific error inside the file itself.
|
||||
# https://github.com/PyCQA/flake8/issues/1079
|
||||
# F811 redefinition of unused '...'
|
||||
stdlib/typing.pyi: B, E701, E741, F401, F403, F405, F811
|
||||
stdlib/typing.pyi: B, E741, F401, F403, F405, F811
|
||||
# Generated protobuf files include docstrings,
|
||||
# and import some things from typing_extensions that could be imported from typing
|
||||
*_pb2.pyi: B, E701, E741, F401, F403, F405, Y021, Y023, Y026, Y053, Y054
|
||||
*_pb2.pyi: B, E741, F401, F403, F405, Y021, Y023, Y026, Y053, Y054
|
||||
|
||||
exclude = .venv*,.git
|
||||
noqa_require_code = true
|
||||
|
||||
@@ -10,7 +10,7 @@ repos:
|
||||
- id: mixed-line-ending
|
||||
- id: check-case-conflict
|
||||
- repo: https://github.com/psf/black-pre-commit-mirror
|
||||
rev: 23.12.1 # must match requirements-tests.txt
|
||||
rev: 24.1.1 # must match requirements-tests.txt
|
||||
hooks:
|
||||
- id: black
|
||||
language_version: python3.10
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Type checkers and other linters that we test our stubs against. These should always
|
||||
# be pinned to a specific version to make failure reproducible. See also the
|
||||
# "tool.typeshed" section in pyproject.toml for additional type checkers.
|
||||
black==23.12.1 # must match .pre-commit-config.yaml
|
||||
black==24.1.1 # must match .pre-commit-config.yaml
|
||||
flake8==6.1.0 # must match .pre-commit-config.yaml
|
||||
flake8-bugbear==23.12.2 # must match .pre-commit-config.yaml
|
||||
flake8-noqa==1.3.2 # must match .pre-commit-config.yaml
|
||||
|
||||
@@ -553,5 +553,6 @@ if sys.platform != "win32":
|
||||
major: int
|
||||
minor: int
|
||||
patch: int
|
||||
|
||||
ncurses_version: _ncurses_version
|
||||
window = _CursesWindow # undocumented
|
||||
|
||||
@@ -45,6 +45,7 @@ if sys.platform == "win32":
|
||||
# Don't exist at runtime
|
||||
__new__: None # type: ignore[assignment]
|
||||
__init__: None # type: ignore[assignment]
|
||||
|
||||
def UuidCreate() -> str: ...
|
||||
def FCICreate(__cabname: str, __files: list[str]) -> None: ...
|
||||
def OpenDatabase(__path: str, __persist: int) -> _Database: ...
|
||||
|
||||
@@ -32,6 +32,7 @@ def get_native_id() -> int: ... # only available on some platforms
|
||||
class _ExceptHookArgs(structseq[Any], tuple[type[BaseException], BaseException | None, TracebackType | None, Thread | None]):
|
||||
if sys.version_info >= (3, 10):
|
||||
__match_args__: Final = ("exc_type", "exc_value", "exc_traceback", "thread")
|
||||
|
||||
@property
|
||||
def exc_type(self) -> type[BaseException]: ...
|
||||
@property
|
||||
|
||||
@@ -25,6 +25,7 @@ if sys.version_info >= (3, 11):
|
||||
STATE_CON_MADE: str
|
||||
STATE_EOF: str
|
||||
STATE_CON_LOST: str
|
||||
|
||||
def add_flowcontrol_defaults(high: int | None, low: int | None, kb: int) -> tuple[int, int]: ...
|
||||
|
||||
else:
|
||||
|
||||
@@ -96,6 +96,7 @@ if sys.platform != "win32":
|
||||
def __exit__(self, a: type[BaseException] | None, b: BaseException | None, c: types.TracebackType | None) -> None: ...
|
||||
def add_child_handler(self, pid: int, callback: Callable[[Unpack[_Ts]], object], *args: Unpack[_Ts]) -> None: ...
|
||||
def remove_child_handler(self, pid: int) -> bool: ...
|
||||
|
||||
else:
|
||||
class SafeChildWatcher(BaseChildWatcher):
|
||||
def __enter__(self) -> Self: ...
|
||||
@@ -120,6 +121,7 @@ if sys.platform != "win32":
|
||||
else:
|
||||
def get_child_watcher(self) -> AbstractChildWatcher: ...
|
||||
def set_child_watcher(self, watcher: AbstractChildWatcher | None) -> None: ...
|
||||
|
||||
SelectorEventLoop = _UnixSelectorEventLoop
|
||||
|
||||
DefaultEventLoopPolicy = _UnixDefaultEventLoopPolicy
|
||||
@@ -136,6 +138,7 @@ if sys.platform != "win32":
|
||||
def add_child_handler(self, pid: int, callback: Callable[[Unpack[_Ts]], object], *args: Unpack[_Ts]) -> None: ...
|
||||
def remove_child_handler(self, pid: int) -> bool: ...
|
||||
def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
|
||||
|
||||
else:
|
||||
class MultiLoopChildWatcher(AbstractChildWatcher):
|
||||
def is_active(self) -> bool: ...
|
||||
|
||||
@@ -69,6 +69,7 @@ if sys.platform == "win32":
|
||||
def recvfrom_into(
|
||||
self, conn: socket.socket, buf: WriteableBuffer, flags: int = 0
|
||||
) -> futures.Future[tuple[int, socket._RetAddress]]: ...
|
||||
|
||||
SelectorEventLoop = _WindowsSelectorEventLoop
|
||||
|
||||
class WindowsSelectorEventLoopPolicy(events.BaseDefaultEventLoopPolicy):
|
||||
@@ -80,4 +81,5 @@ if sys.platform == "win32":
|
||||
_loop_factory: ClassVar[type[ProactorEventLoop]]
|
||||
def get_child_watcher(self) -> NoReturn: ...
|
||||
def set_child_watcher(self, watcher: Any) -> NoReturn: ...
|
||||
|
||||
DefaultEventLoopPolicy = WindowsSelectorEventLoopPolicy
|
||||
|
||||
@@ -166,6 +166,7 @@ if sys.version_info >= (3, 12):
|
||||
OCTOBER: Literal[10]
|
||||
NOVEMBER: Literal[11]
|
||||
DECEMBER: Literal[12]
|
||||
|
||||
JANUARY = Month.JANUARY
|
||||
FEBRUARY = Month.FEBRUARY
|
||||
MARCH = Month.MARCH
|
||||
@@ -187,6 +188,7 @@ if sys.version_info >= (3, 12):
|
||||
FRIDAY: Literal[4]
|
||||
SATURDAY: Literal[5]
|
||||
SUNDAY: Literal[6]
|
||||
|
||||
MONDAY = Day.MONDAY
|
||||
TUESDAY = Day.TUESDAY
|
||||
WEDNESDAY = Day.WEDNESDAY
|
||||
|
||||
@@ -118,6 +118,7 @@ class closing(AbstractContextManager[_SupportsCloseT]):
|
||||
if sys.version_info >= (3, 10):
|
||||
class _SupportsAclose(Protocol):
|
||||
def aclose(self) -> Awaitable[object]: ...
|
||||
|
||||
_SupportsAcloseT = TypeVar("_SupportsAcloseT", bound=_SupportsAclose)
|
||||
|
||||
class aclosing(AbstractAsyncContextManager[_SupportsAcloseT]):
|
||||
|
||||
@@ -37,4 +37,5 @@ if sys.platform != "win32":
|
||||
# Don't exist at runtime
|
||||
__new__: None # type: ignore[assignment]
|
||||
__init__: None # type: ignore[assignment]
|
||||
|
||||
def open(__filename: str, __flags: str = "r", __mode: int = 0o666) -> _gdbm: ...
|
||||
|
||||
@@ -33,4 +33,5 @@ if sys.platform != "win32":
|
||||
# Don't exist at runtime
|
||||
__new__: None # type: ignore[assignment]
|
||||
__init__: None # type: ignore[assignment]
|
||||
|
||||
def open(__filename: str, __flags: str = "r", __mode: int = 0o666) -> _dbm: ...
|
||||
|
||||
@@ -175,6 +175,7 @@ if sys.version_info >= (3, 11):
|
||||
name: str
|
||||
clsname: str
|
||||
member: Enum | None
|
||||
|
||||
_magic_enum_attr = property
|
||||
else:
|
||||
_magic_enum_attr = types.DynamicClassAttribute
|
||||
@@ -261,6 +262,7 @@ if sys.version_info >= (3, 11):
|
||||
CONTINUOUS: str
|
||||
NAMED_FLAGS: str
|
||||
UNIQUE: str
|
||||
|
||||
CONTINUOUS = EnumCheck.CONTINUOUS
|
||||
NAMED_FLAGS = EnumCheck.NAMED_FLAGS
|
||||
UNIQUE = EnumCheck.UNIQUE
|
||||
@@ -274,6 +276,7 @@ if sys.version_info >= (3, 11):
|
||||
CONFORM: str
|
||||
EJECT: str
|
||||
KEEP: str
|
||||
|
||||
STRICT = FlagBoundary.STRICT
|
||||
CONFORM = FlagBoundary.CONFORM
|
||||
EJECT = FlagBoundary.EJECT
|
||||
|
||||
@@ -7,6 +7,7 @@ if sys.platform != "win32":
|
||||
class struct_group(structseq[Any], tuple[str, str | None, int, list[str]]):
|
||||
if sys.version_info >= (3, 10):
|
||||
__match_args__: Final = ("gr_name", "gr_passwd", "gr_gid", "gr_mem")
|
||||
|
||||
@property
|
||||
def gr_name(self) -> str: ...
|
||||
@property
|
||||
|
||||
@@ -43,6 +43,7 @@ class PackageNotFoundError(ModuleNotFoundError):
|
||||
if sys.version_info >= (3, 11):
|
||||
class DeprecatedTuple:
|
||||
def __getitem__(self, item: int) -> str: ...
|
||||
|
||||
_EntryPointBase = DeprecatedTuple
|
||||
else:
|
||||
class _EntryPointBase(NamedTuple):
|
||||
|
||||
@@ -430,6 +430,7 @@ if sys.version_info < (3, 11):
|
||||
varargs: str | None
|
||||
keywords: str | None
|
||||
defaults: tuple[Any, ...]
|
||||
|
||||
def getargspec(func: object) -> ArgSpec: ...
|
||||
|
||||
class FullArgSpec(NamedTuple):
|
||||
|
||||
@@ -56,6 +56,7 @@ if sys.platform == "win32":
|
||||
def gen_id(self, file: str) -> str: ...
|
||||
def append(self, full: str, file: str, logical: str) -> tuple[int, str]: ...
|
||||
def commit(self, db: _Database) -> None: ...
|
||||
|
||||
_directories: set[str]
|
||||
|
||||
class Directory:
|
||||
|
||||
@@ -86,4 +86,5 @@ class AbstractReducer(metaclass=ABCMeta):
|
||||
sendfds = _sendfds
|
||||
recvfds = _recvfds
|
||||
DupFd = _DupFd
|
||||
|
||||
def __init__(self, *args: Unused) -> None: ...
|
||||
|
||||
@@ -341,6 +341,7 @@ class stat_result(structseq[float], tuple[int, int, int, int, int, int, int, flo
|
||||
# More items may be added at the end by some implementations.
|
||||
if sys.version_info >= (3, 10):
|
||||
__match_args__: Final = ("st_mode", "st_ino", "st_dev", "st_nlink", "st_uid", "st_gid", "st_size")
|
||||
|
||||
@property
|
||||
def st_mode(self) -> int: ... # protection bits,
|
||||
@property
|
||||
@@ -446,6 +447,7 @@ class statvfs_result(structseq[int], tuple[int, int, int, int, int, int, int, in
|
||||
"f_flag",
|
||||
"f_namemax",
|
||||
)
|
||||
|
||||
@property
|
||||
def f_bsize(self) -> int: ...
|
||||
@property
|
||||
@@ -488,6 +490,7 @@ def umask(__mask: int) -> int: ...
|
||||
class uname_result(structseq[str], tuple[str, str, str, str, str]):
|
||||
if sys.version_info >= (3, 10):
|
||||
__match_args__: Final = ("sysname", "nodename", "release", "version", "machine")
|
||||
|
||||
@property
|
||||
def sysname(self) -> str: ...
|
||||
@property
|
||||
@@ -704,6 +707,7 @@ if sys.platform != "win32":
|
||||
class terminal_size(structseq[int], tuple[int, int]):
|
||||
if sys.version_info >= (3, 10):
|
||||
__match_args__: Final = ("columns", "lines")
|
||||
|
||||
@property
|
||||
def columns(self) -> int: ...
|
||||
@property
|
||||
@@ -925,6 +929,7 @@ def system(command: StrOrBytesPath) -> int: ...
|
||||
class times_result(structseq[float], tuple[float, float, float, float, float]):
|
||||
if sys.version_info >= (3, 10):
|
||||
__match_args__: Final = ("user", "system", "children_user", "children_system", "elapsed")
|
||||
|
||||
@property
|
||||
def user(self) -> float: ...
|
||||
@property
|
||||
@@ -962,6 +967,7 @@ else:
|
||||
class waitid_result(structseq[int], tuple[int, int, int, int, int]):
|
||||
if sys.version_info >= (3, 10):
|
||||
__match_args__: Final = ("si_pid", "si_uid", "si_signo", "si_status", "si_code")
|
||||
|
||||
@property
|
||||
def si_pid(self) -> int: ...
|
||||
@property
|
||||
@@ -1022,6 +1028,7 @@ if sys.platform != "win32":
|
||||
class sched_param(structseq[int], tuple[int]):
|
||||
if sys.version_info >= (3, 10):
|
||||
__match_args__: Final = ("sched_priority",)
|
||||
|
||||
def __new__(cls, sched_priority: int) -> Self: ...
|
||||
@property
|
||||
def sched_priority(self) -> int: ...
|
||||
|
||||
@@ -36,6 +36,7 @@ if sys.version_info >= (3, 9):
|
||||
percall_cumtime: float
|
||||
file_name: str
|
||||
line_number: int
|
||||
|
||||
@dataclass(unsafe_hash=True)
|
||||
class StatsProfile:
|
||||
total_tt: float
|
||||
|
||||
@@ -7,6 +7,7 @@ if sys.platform != "win32":
|
||||
class struct_passwd(structseq[Any], tuple[str, str, int, int, str, str, str]):
|
||||
if sys.version_info >= (3, 10):
|
||||
__match_args__: Final = ("pw_name", "pw_passwd", "pw_uid", "pw_gid", "pw_gecos", "pw_dir", "pw_shell")
|
||||
|
||||
@property
|
||||
def pw_name(self) -> str: ...
|
||||
@property
|
||||
|
||||
@@ -52,9 +52,12 @@ class XMLParserType:
|
||||
EndDoctypeDeclHandler: Callable[[], Any] | None
|
||||
ElementDeclHandler: Callable[[str, _Model], Any] | None
|
||||
AttlistDeclHandler: Callable[[str, str, str, str | None, bool], Any] | None
|
||||
StartElementHandler: Callable[[str, dict[str, str]], Any] | Callable[[str, list[str]], Any] | Callable[
|
||||
[str, dict[str, str], list[str]], Any
|
||||
] | None
|
||||
StartElementHandler: (
|
||||
Callable[[str, dict[str, str]], Any]
|
||||
| Callable[[str, list[str]], Any]
|
||||
| Callable[[str, dict[str, str], list[str]], Any]
|
||||
| None
|
||||
)
|
||||
EndElementHandler: Callable[[str], Any] | None
|
||||
ProcessingInstructionHandler: Callable[[str, str], Any] | None
|
||||
CharacterDataHandler: Callable[[str], Any] | None
|
||||
|
||||
@@ -24,6 +24,7 @@ if sys.platform != "win32":
|
||||
RLIMIT_RTTIME: int
|
||||
RLIMIT_SIGPENDING: int
|
||||
RUSAGE_THREAD: int
|
||||
|
||||
@final
|
||||
class struct_rusage(
|
||||
structseq[float], tuple[float, float, int, int, int, int, int, int, int, int, int, int, int, int, int, int]
|
||||
@@ -47,6 +48,7 @@ if sys.platform != "win32":
|
||||
"ru_nvcsw",
|
||||
"ru_nivcsw",
|
||||
)
|
||||
|
||||
@property
|
||||
def ru_utime(self) -> float: ...
|
||||
@property
|
||||
|
||||
@@ -52,6 +52,7 @@ if sys.platform != "linux" and sys.platform != "win32":
|
||||
data: Any = ...,
|
||||
udata: Any = ...,
|
||||
) -> None: ...
|
||||
|
||||
# BSD only
|
||||
@final
|
||||
class kqueue:
|
||||
@@ -64,6 +65,7 @@ if sys.platform != "linux" and sys.platform != "win32":
|
||||
def fileno(self) -> int: ...
|
||||
@classmethod
|
||||
def fromfd(cls, __fd: FileDescriptorLike) -> kqueue: ...
|
||||
|
||||
KQ_EV_ADD: int
|
||||
KQ_EV_CLEAR: int
|
||||
KQ_EV_DELETE: int
|
||||
@@ -123,6 +125,7 @@ if sys.platform == "linux":
|
||||
def poll(self, timeout: float | None = None, maxevents: int = -1) -> list[tuple[int, int]]: ...
|
||||
@classmethod
|
||||
def fromfd(cls, __fd: FileDescriptorLike) -> epoll: ...
|
||||
|
||||
EPOLLERR: int
|
||||
EPOLLEXCLUSIVE: int
|
||||
EPOLLET: int
|
||||
|
||||
@@ -126,6 +126,7 @@ else:
|
||||
SIG_BLOCK: int
|
||||
SIG_UNBLOCK: int
|
||||
SIG_SETMASK: int
|
||||
|
||||
SIG_BLOCK = Sigmasks.SIG_BLOCK
|
||||
SIG_UNBLOCK = Sigmasks.SIG_UNBLOCK
|
||||
SIG_SETMASK = Sigmasks.SIG_SETMASK
|
||||
@@ -153,10 +154,12 @@ else:
|
||||
SIGRTMIN: Signals
|
||||
if sys.version_info >= (3, 11):
|
||||
SIGSTKFLT: Signals
|
||||
|
||||
@final
|
||||
class struct_siginfo(structseq[int], tuple[int, int, int, int, int, int, int]):
|
||||
if sys.version_info >= (3, 10):
|
||||
__match_args__: Final = ("si_signo", "si_code", "si_errno", "si_pid", "si_uid", "si_status", "si_band")
|
||||
|
||||
@property
|
||||
def si_signo(self) -> int: ...
|
||||
@property
|
||||
|
||||
@@ -17,6 +17,7 @@ if sys.platform != "win32":
|
||||
"sp_expire",
|
||||
"sp_flag",
|
||||
)
|
||||
|
||||
@property
|
||||
def sp_namp(self) -> str: ...
|
||||
@property
|
||||
|
||||
@@ -2592,6 +2592,7 @@ if sys.platform == "win32":
|
||||
wShowWindow: int
|
||||
lpAttributeList: Mapping[str, Any]
|
||||
def copy(self) -> STARTUPINFO: ...
|
||||
|
||||
from _winapi import (
|
||||
ABOVE_NORMAL_PRIORITY_CLASS as ABOVE_NORMAL_PRIORITY_CLASS,
|
||||
BELOW_NORMAL_PRIORITY_CLASS as BELOW_NORMAL_PRIORITY_CLASS,
|
||||
|
||||
@@ -39,6 +39,7 @@ if sys.version_info >= (3, 9) and sys.platform == "linux":
|
||||
class struct_time(structseq[Any | int], _TimeTuple):
|
||||
if sys.version_info >= (3, 10):
|
||||
__match_args__: Final = ("tm_year", "tm_mon", "tm_mday", "tm_hour", "tm_min", "tm_sec", "tm_wday", "tm_yday", "tm_isdst")
|
||||
|
||||
@property
|
||||
def tm_year(self) -> int: ...
|
||||
@property
|
||||
|
||||
@@ -273,6 +273,7 @@ if sys.version_info >= (3, 10):
|
||||
|
||||
def __or__(self, right: Any) -> _SpecialForm: ...
|
||||
def __ror__(self, left: Any) -> _SpecialForm: ...
|
||||
|
||||
Concatenate: _SpecialForm
|
||||
TypeAlias: _SpecialForm
|
||||
TypeGuard: _SpecialForm
|
||||
@@ -864,6 +865,7 @@ class NamedTuple(tuple[Any, ...]):
|
||||
# So we only add it to the stub on 3.12+.
|
||||
if sys.version_info >= (3, 12):
|
||||
__orig_bases__: ClassVar[tuple[Any, ...]]
|
||||
|
||||
@overload
|
||||
def __init__(self, __typename: str, __fields: Iterable[tuple[str, Any]]) -> None: ...
|
||||
@overload
|
||||
@@ -885,6 +887,7 @@ class _TypedDict(Mapping[str, object], metaclass=ABCMeta):
|
||||
# so we only add it to the stub on 3.12+
|
||||
if sys.version_info >= (3, 12):
|
||||
__orig_bases__: ClassVar[tuple[Any, ...]]
|
||||
|
||||
def copy(self) -> typing_extensions.Self: ...
|
||||
# Using Never so that only calls using mypy plugin hook that specialize the signature
|
||||
# can go through.
|
||||
|
||||
@@ -27,6 +27,7 @@ class TestResult:
|
||||
tb_locals: bool
|
||||
if sys.version_info >= (3, 12):
|
||||
collectedDurations: _DurationsType
|
||||
|
||||
def __init__(self, stream: TextIO | None = None, descriptions: bool | None = None, verbosity: int | None = None) -> None: ...
|
||||
def printErrors(self) -> None: ...
|
||||
def wasSuccessful(self) -> bool: ...
|
||||
|
||||
@@ -37,9 +37,11 @@ class Config: # should inherit from alembic.config.Config which is not possible
|
||||
stdout: SupportsWrite[str] = sys.stdout,
|
||||
cmd_opts: Namespace | None = None,
|
||||
config_args: SupportsKeysAndGetItem[str, _AlembicConfigValue] | Iterable[tuple[str, _AlembicConfigValue]] = ...,
|
||||
attributes: SupportsKeysAndGetItem[_AlembicConfigValue, _AlembicConfigValue]
|
||||
| Iterable[tuple[_AlembicConfigValue, _AlembicConfigValue]]
|
||||
| None = None,
|
||||
attributes: (
|
||||
SupportsKeysAndGetItem[_AlembicConfigValue, _AlembicConfigValue]
|
||||
| Iterable[tuple[_AlembicConfigValue, _AlembicConfigValue]]
|
||||
| None
|
||||
) = None,
|
||||
*,
|
||||
template_directory: str | None = None,
|
||||
) -> None: ...
|
||||
|
||||
@@ -4,21 +4,17 @@ from wtforms import Field, Form
|
||||
|
||||
|
||||
class Filter1:
|
||||
def __call__(self, value: object) -> None:
|
||||
...
|
||||
def __call__(self, value: object) -> None: ...
|
||||
|
||||
|
||||
class Filter2:
|
||||
def __call__(self, input: None) -> None:
|
||||
...
|
||||
def __call__(self, input: None) -> None: ...
|
||||
|
||||
|
||||
def not_a_filter(a: object, b: object) -> None:
|
||||
...
|
||||
def not_a_filter(a: object, b: object) -> None: ...
|
||||
|
||||
|
||||
def also_not_a_filter() -> None:
|
||||
...
|
||||
def also_not_a_filter() -> None: ...
|
||||
|
||||
|
||||
# we should accept any mapping of sequences, we can't really validate
|
||||
|
||||
@@ -98,6 +98,7 @@ class LRUCache(dict[_KT, _VT]):
|
||||
key = ...
|
||||
value = ...
|
||||
def __init__(self, key, value) -> None: ...
|
||||
|
||||
_dict: dict[_KT, LRUCache._Item]
|
||||
capacity: int
|
||||
head: LRUCache._Item | None
|
||||
|
||||
@@ -13,6 +13,7 @@ class Address(Resource):
|
||||
Ground: str
|
||||
Electronic: str
|
||||
ShipToStore: str
|
||||
|
||||
@staticmethod
|
||||
def create(params: Incomplete | None = None): ...
|
||||
@staticmethod
|
||||
|
||||
@@ -7,6 +7,7 @@ class ApplePayCard(Resource):
|
||||
AmEx: str
|
||||
MasterCard: str
|
||||
Visa: str
|
||||
|
||||
is_expired: Any
|
||||
subscriptions: Any
|
||||
def __init__(self, gateway, attributes) -> None: ...
|
||||
|
||||
@@ -35,6 +35,7 @@ class CreditCard(Resource):
|
||||
Yes: str
|
||||
No: str
|
||||
Unknown: str
|
||||
|
||||
Commercial: Any
|
||||
DurbinRegulated: Any
|
||||
Debit: Any
|
||||
|
||||
@@ -12,6 +12,7 @@ class CreditCardVerification(AttributeGetter):
|
||||
GatewayRejected: str
|
||||
ProcessorDeclined: str
|
||||
Verified: str
|
||||
|
||||
amount: Any
|
||||
currency_iso_code: Any
|
||||
processor_response_code: Any
|
||||
|
||||
@@ -8,6 +8,7 @@ class Disbursement(Resource):
|
||||
class Type:
|
||||
Credit: str
|
||||
Debit: str
|
||||
|
||||
amount: Any
|
||||
merchant_account: Any
|
||||
def __init__(self, gateway, attributes) -> None: ...
|
||||
|
||||
@@ -40,6 +40,7 @@ class Dispute(AttributeGetter):
|
||||
Effortless: str
|
||||
Standard: str
|
||||
NotProtected: str
|
||||
|
||||
@staticmethod
|
||||
def accept(id): ...
|
||||
@staticmethod
|
||||
|
||||
@@ -7,6 +7,7 @@ from braintree.successful_result import SuccessfulResult as SuccessfulResult
|
||||
class DocumentUpload(Resource):
|
||||
class Kind:
|
||||
EvidenceDocument: str
|
||||
|
||||
@staticmethod
|
||||
def create(params: Incomplete | None = None): ...
|
||||
@staticmethod
|
||||
|
||||
@@ -5,5 +5,6 @@ class EuropeBankAccount(Resource):
|
||||
class MandateType:
|
||||
Business: str
|
||||
Consumer: str
|
||||
|
||||
@staticmethod
|
||||
def signature(): ...
|
||||
|
||||
@@ -19,6 +19,7 @@ class MerchantAccount(Resource):
|
||||
Bank: str
|
||||
Email: str
|
||||
MobilePhone: str
|
||||
|
||||
FundingDestinations: Any
|
||||
individual_details: Any
|
||||
business_details: Any
|
||||
|
||||
@@ -30,6 +30,7 @@ class Subscription(Resource):
|
||||
Expired: str
|
||||
PastDue: str
|
||||
Pending: str
|
||||
|
||||
@staticmethod
|
||||
def create(params: Incomplete | None = None): ...
|
||||
@staticmethod
|
||||
|
||||
@@ -97,6 +97,7 @@ class Transaction(Resource):
|
||||
Telephone: str
|
||||
Laundry: str
|
||||
Other: str
|
||||
|
||||
@staticmethod
|
||||
def adjust_authorization(transaction_id, amount): ...
|
||||
@staticmethod
|
||||
|
||||
@@ -6,6 +6,7 @@ class TransactionLineItem(AttributeGetter):
|
||||
class Kind:
|
||||
Credit: str
|
||||
Debit: str
|
||||
|
||||
def __init__(self, attributes) -> None: ...
|
||||
@staticmethod
|
||||
def find_all(transaction_id): ...
|
||||
|
||||
@@ -17,6 +17,7 @@ class UsBankAccountVerification(AttributeGetter):
|
||||
IndependentCheck: str
|
||||
TokenizedCheck: str
|
||||
MicroTransfers: str
|
||||
|
||||
us_bank_account: Any
|
||||
def __init__(self, gateway, attributes) -> None: ...
|
||||
@staticmethod
|
||||
|
||||
@@ -27,6 +27,7 @@ class Http:
|
||||
Xml: str
|
||||
Multipart: str
|
||||
Json: str
|
||||
|
||||
@staticmethod
|
||||
def is_error_status(status): ...
|
||||
@staticmethod
|
||||
|
||||
@@ -59,6 +59,7 @@ class WebhookNotification(Resource):
|
||||
TransactionDisbursed: str
|
||||
TransactionSettled: str
|
||||
TransactionSettlementDeclined: str
|
||||
|
||||
@staticmethod
|
||||
def parse(signature, payload): ...
|
||||
@staticmethod
|
||||
|
||||
@@ -18,6 +18,7 @@ if sys.platform == "win32":
|
||||
wAttributes: wintypes.WORD
|
||||
srWindow: wintypes.SMALL_RECT
|
||||
dwMaximumWindowSize: COORD
|
||||
|
||||
def winapi_test() -> bool: ...
|
||||
def GetConsoleScreenBufferInfo(stream_id: int = -11) -> CONSOLE_SCREEN_BUFFER_INFO: ...
|
||||
def SetConsoleTextAttribute(stream_id: int, attrs: wintypes.WORD) -> wintypes.BOOL: ...
|
||||
|
||||
@@ -24,6 +24,7 @@ class loop(AbstractLoop):
|
||||
ref: bool
|
||||
active: bool
|
||||
closing: bool
|
||||
|
||||
def debug(self) -> list[_HandleState]: ...
|
||||
def install_sigchld(self) -> None: ...
|
||||
def reset_sigchld(self) -> None: ...
|
||||
|
||||
@@ -59,6 +59,7 @@ class MemcacheCache(GlobalCache):
|
||||
key: Any
|
||||
def __init__(self, key) -> None: ...
|
||||
def __eq__(self, other): ...
|
||||
|
||||
transient_errors: Any
|
||||
@classmethod
|
||||
def from_environment(cls, max_pool_size: int = ..., strict_read: bool = ..., strict_write: bool = ...) -> Self: ...
|
||||
|
||||
@@ -85,19 +85,21 @@ class WriteApi(_BaseWriteApi):
|
||||
self,
|
||||
bucket: str,
|
||||
org: str | None = None,
|
||||
record: str
|
||||
| Iterable[str]
|
||||
| Point
|
||||
| Iterable[Point]
|
||||
| dict[Incomplete, Incomplete]
|
||||
| Iterable[dict[Incomplete, Incomplete]]
|
||||
| bytes
|
||||
| Iterable[bytes]
|
||||
| _Observable
|
||||
| _NamedTuple
|
||||
| Iterable[_NamedTuple]
|
||||
| _DataClass
|
||||
| Iterable[_DataClass] = None,
|
||||
record: (
|
||||
str
|
||||
| Iterable[str]
|
||||
| Point
|
||||
| Iterable[Point]
|
||||
| dict[Incomplete, Incomplete]
|
||||
| Iterable[dict[Incomplete, Incomplete]]
|
||||
| bytes
|
||||
| Iterable[bytes]
|
||||
| _Observable
|
||||
| _NamedTuple
|
||||
| Iterable[_NamedTuple]
|
||||
| _DataClass
|
||||
| Iterable[_DataClass]
|
||||
) = None,
|
||||
write_precision: _WritePrecision = "ns",
|
||||
**kwargs,
|
||||
) -> Any: ...
|
||||
|
||||
@@ -19,18 +19,20 @@ class WriteApiAsync(_BaseWriteApi):
|
||||
self,
|
||||
bucket: str,
|
||||
org: str | None = None,
|
||||
record: str
|
||||
| Iterable[str]
|
||||
| Point
|
||||
| Iterable[Point]
|
||||
| dict[Incomplete, Incomplete]
|
||||
| Iterable[dict[Incomplete, Incomplete]]
|
||||
| bytes
|
||||
| Iterable[bytes]
|
||||
| _NamedTuple
|
||||
| Iterable[_NamedTuple]
|
||||
| _DataClass
|
||||
| Iterable[_DataClass] = None,
|
||||
record: (
|
||||
str
|
||||
| Iterable[str]
|
||||
| Point
|
||||
| Iterable[Point]
|
||||
| dict[Incomplete, Incomplete]
|
||||
| Iterable[dict[Incomplete, Incomplete]]
|
||||
| bytes
|
||||
| Iterable[bytes]
|
||||
| _NamedTuple
|
||||
| Iterable[_NamedTuple]
|
||||
| _DataClass
|
||||
| Iterable[_DataClass]
|
||||
) = None,
|
||||
write_precision: _WritePrecision = "ns",
|
||||
**kwargs,
|
||||
) -> bool: ...
|
||||
|
||||
@@ -9,6 +9,7 @@ class AsyncStrategy(BaseStrategy):
|
||||
socket_size: Any
|
||||
def __init__(self, ldap_connection) -> None: ...
|
||||
def run(self) -> None: ...
|
||||
|
||||
sync: bool
|
||||
no_real_dsa: bool
|
||||
pooled: bool
|
||||
|
||||
@@ -60,6 +60,7 @@ class ReusableStrategy(BaseStrategy):
|
||||
worker_lock: Any
|
||||
def __init__(self, connection, request_queue) -> None: ...
|
||||
def new_connection(self) -> None: ...
|
||||
|
||||
sync: bool
|
||||
no_real_dsa: bool
|
||||
pooled: bool
|
||||
|
||||
@@ -71,6 +71,7 @@ class ArborescenceIterator:
|
||||
class Partition:
|
||||
mst_weight: float
|
||||
partition_dict: dict[Incomplete, Incomplete]
|
||||
|
||||
G: Incomplete
|
||||
weight: Incomplete
|
||||
minimum: Incomplete
|
||||
|
||||
@@ -34,6 +34,7 @@ class SpanningTreeIterator:
|
||||
class Partition:
|
||||
mst_weight: float
|
||||
partition_dict: dict[Incomplete, Incomplete]
|
||||
|
||||
G: Incomplete
|
||||
weight: Incomplete
|
||||
minimum: Incomplete
|
||||
|
||||
@@ -155,10 +155,9 @@ class DisplayUnitsLabelList(Serialisable):
|
||||
def __init__(
|
||||
self,
|
||||
custUnit: _HasTagAndGet[ConvertibleToFloat | None] | ConvertibleToFloat | None = None,
|
||||
builtInUnit: _HasTagAndGet[_DisplayUnitsLabelListBuiltInUnit]
|
||||
| _DisplayUnitsLabelListBuiltInUnit
|
||||
| Literal["none"]
|
||||
| None = None,
|
||||
builtInUnit: (
|
||||
_HasTagAndGet[_DisplayUnitsLabelListBuiltInUnit] | _DisplayUnitsLabelListBuiltInUnit | Literal["none"] | None
|
||||
) = None,
|
||||
dispUnitsLbl: DisplayUnitsLabel | None = None,
|
||||
extLst: Unused = None,
|
||||
) -> None: ...
|
||||
|
||||
@@ -18,9 +18,14 @@ class NestedBoolText(Bool[Incomplete], NestedText[Incomplete, Incomplete]): ...
|
||||
class _TypedProperty(Strict, Generic[_T]):
|
||||
name: String[Literal[False]]
|
||||
# Since this is internal, just list all possible values
|
||||
value: Integer[Literal[False]] | Float[Literal[False]] | String[Literal[True]] | DateTime[Literal[False]] | Bool[
|
||||
Literal[False]
|
||||
] | String[Literal[False]]
|
||||
value: (
|
||||
Integer[Literal[False]]
|
||||
| Float[Literal[False]]
|
||||
| String[Literal[True]]
|
||||
| DateTime[Literal[False]]
|
||||
| Bool[Literal[False]]
|
||||
| String[Literal[False]]
|
||||
)
|
||||
def __init__(self, name: str, value: _T) -> None: ...
|
||||
def __eq__(self, other: _TypedProperty[Any]) -> bool: ... # type: ignore[override]
|
||||
|
||||
|
||||
@@ -231,11 +231,13 @@ class Worksheet(_WorkbookChild):
|
||||
) -> None: ...
|
||||
def append(
|
||||
self,
|
||||
iterable: list[Incomplete]
|
||||
| tuple[Incomplete, ...]
|
||||
| range
|
||||
| GeneratorType[Incomplete, object, object]
|
||||
| dict[int | str, Incomplete],
|
||||
iterable: (
|
||||
list[Incomplete]
|
||||
| tuple[Incomplete, ...]
|
||||
| range
|
||||
| GeneratorType[Incomplete, object, object]
|
||||
| dict[int | str, Incomplete]
|
||||
),
|
||||
) -> None: ...
|
||||
def insert_rows(self, idx: int, amount: int = 1) -> None: ...
|
||||
def insert_cols(self, idx: int, amount: int = 1) -> None: ...
|
||||
|
||||
@@ -42,6 +42,7 @@ if sys.platform == "win32":
|
||||
def __exit__(
|
||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, tb: TracebackType | None
|
||||
) -> None: ...
|
||||
|
||||
READ_CONTROL: int
|
||||
STANDARD_RIGHTS_REQUIRED: int
|
||||
STANDARD_RIGHTS_READ: int
|
||||
|
||||
@@ -54,6 +54,7 @@ class BlockingConnection:
|
||||
|
||||
class _OnChannelOpenedArgs(NamedTuple):
|
||||
channel: Incomplete
|
||||
|
||||
def __init__(
|
||||
self, parameters: Parameters | Sequence[Parameters] | None = None, _impl_class: Incomplete | None = None
|
||||
) -> None: ...
|
||||
@@ -164,6 +165,7 @@ class BlockingChannel:
|
||||
|
||||
class _FlowOkCallbackResultArgs(NamedTuple):
|
||||
active: Incomplete
|
||||
|
||||
def __init__(self, channel_impl, connection) -> None: ...
|
||||
def __int__(self) -> int: ...
|
||||
def __enter__(self): ...
|
||||
|
||||
@@ -159,6 +159,7 @@ class Process:
|
||||
private: Any
|
||||
ref_count: Any
|
||||
shadow_count: Any
|
||||
|
||||
def open_files(self): ...
|
||||
def num_fds(self): ...
|
||||
def cpu_affinity_get(self): ...
|
||||
|
||||
@@ -129,6 +129,7 @@ class Process:
|
||||
rss: Incomplete
|
||||
anon: Incomplete
|
||||
locked: Incomplete
|
||||
|
||||
def memory_maps(self): ...
|
||||
def num_fds(self): ...
|
||||
def num_ctx_switches(self): ...
|
||||
|
||||
@@ -15,6 +15,7 @@ class TimeMixIn:
|
||||
def utcoffset(self, dt): ...
|
||||
def tzname(self, dt): ...
|
||||
def dst(self, dt): ...
|
||||
|
||||
UTC: FixedOffset
|
||||
@property
|
||||
def asDateTime(self): ...
|
||||
|
||||
@@ -54,6 +54,7 @@ class Events(Generic[_T, _AbstractListener_T]):
|
||||
|
||||
class Event:
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
|
||||
_event_queue: Queue[_T] # undocumented
|
||||
_sentinel: object # undocumented
|
||||
_listener: _AbstractListener_T # undocumented
|
||||
|
||||
@@ -35,6 +35,7 @@ if sys.platform == "win32":
|
||||
ClassGuid: ctypes._CField[Incomplete, Incomplete, Incomplete]
|
||||
DevInst: ctypes._CField[Incomplete, Incomplete, Incomplete]
|
||||
Reserved: ctypes._CField[Incomplete, Incomplete, Incomplete]
|
||||
|
||||
PSP_DEVINFO_DATA: type[ctypes._Pointer[SP_DEVINFO_DATA]]
|
||||
PSP_DEVICE_INTERFACE_DETAIL_DATA = ctypes.c_void_p
|
||||
setupapi: ctypes.WinDLL
|
||||
|
||||
@@ -13,6 +13,7 @@ if sys.platform == "win32":
|
||||
nLength: _CField[Incomplete, Incomplete, Incomplete]
|
||||
lpSecurityDescriptor: _CField[Incomplete, Incomplete, Incomplete]
|
||||
bInheritHandle: _CField[Incomplete, Incomplete, Incomplete]
|
||||
|
||||
LPSECURITY_ATTRIBUTES: type[_Pointer[_SECURITY_ATTRIBUTES]]
|
||||
CreateEvent: _NamedFuncPointer
|
||||
CreateFile: _NamedFuncPointer
|
||||
@@ -28,6 +29,7 @@ if sys.platform == "win32":
|
||||
OffsetHigh: _CField[Incomplete, Incomplete, Incomplete]
|
||||
Pointer: _CField[Incomplete, Incomplete, Incomplete]
|
||||
hEvent: _CField[Incomplete, Incomplete, Incomplete]
|
||||
|
||||
OVERLAPPED: TypeAlias = _OVERLAPPED
|
||||
|
||||
class _COMSTAT(Structure):
|
||||
@@ -41,6 +43,7 @@ if sys.platform == "win32":
|
||||
fReserved: _CField[Incomplete, Incomplete, Incomplete]
|
||||
cbInQue: _CField[Incomplete, Incomplete, Incomplete]
|
||||
cbOutQue: _CField[Incomplete, Incomplete, Incomplete]
|
||||
|
||||
COMSTAT: TypeAlias = _COMSTAT
|
||||
|
||||
class _DCB(Structure):
|
||||
@@ -72,6 +75,7 @@ if sys.platform == "win32":
|
||||
EofChar: _CField[Incomplete, Incomplete, Incomplete]
|
||||
EvtChar: _CField[Incomplete, Incomplete, Incomplete]
|
||||
wReserved1: _CField[Incomplete, Incomplete, Incomplete]
|
||||
|
||||
DCB: TypeAlias = _DCB
|
||||
|
||||
class _COMMTIMEOUTS(Structure):
|
||||
@@ -80,6 +84,7 @@ if sys.platform == "win32":
|
||||
ReadTotalTimeoutConstant: _CField[Incomplete, Incomplete, Incomplete]
|
||||
WriteTotalTimeoutMultiplier: _CField[Incomplete, Incomplete, Incomplete]
|
||||
WriteTotalTimeoutConstant: _CField[Incomplete, Incomplete, Incomplete]
|
||||
|
||||
COMMTIMEOUTS: TypeAlias = _COMMTIMEOUTS
|
||||
|
||||
GetLastError: _NamedFuncPointer
|
||||
@@ -159,4 +164,5 @@ if sys.platform == "win32":
|
||||
class N11_OVERLAPPED4DOLLAR_484DOLLAR_49E(Structure):
|
||||
Offset: _CField[Incomplete, Incomplete, Incomplete]
|
||||
OffsetHigh: _CField[Incomplete, Incomplete, Incomplete]
|
||||
|
||||
PVOID: TypeAlias = c_void_p
|
||||
|
||||
@@ -106,11 +106,13 @@ class ClusterGrid(Grid):
|
||||
dendrogram_col: _DendrogramPlotter | None
|
||||
def __init__(
|
||||
self,
|
||||
data: _ListLikeU
|
||||
| DataFrame
|
||||
| dict[Incomplete, Incomplete]
|
||||
| Iterable[_ListLikeU | tuple[Hashable, _ListLikeU] | dict[Incomplete, Incomplete]]
|
||||
| None,
|
||||
data: (
|
||||
_ListLikeU
|
||||
| DataFrame
|
||||
| dict[Incomplete, Incomplete]
|
||||
| Iterable[_ListLikeU | tuple[Hashable, _ListLikeU] | dict[Incomplete, Incomplete]]
|
||||
| None
|
||||
),
|
||||
pivot_kws: Mapping[str, Incomplete] | None = None,
|
||||
z_score: int | None = None,
|
||||
standard_scale: int | None = None,
|
||||
@@ -166,11 +168,13 @@ class ClusterGrid(Grid):
|
||||
) -> Self: ...
|
||||
|
||||
def clustermap(
|
||||
data: _ListLikeU
|
||||
| DataFrame
|
||||
| dict[Incomplete, Incomplete]
|
||||
| Iterable[_ListLikeU | tuple[Hashable, _ListLikeU] | dict[Incomplete, Incomplete]]
|
||||
| None,
|
||||
data: (
|
||||
_ListLikeU
|
||||
| DataFrame
|
||||
| dict[Incomplete, Incomplete]
|
||||
| Iterable[_ListLikeU | tuple[Hashable, _ListLikeU] | dict[Incomplete, Incomplete]]
|
||||
| None
|
||||
),
|
||||
*,
|
||||
pivot_kws: dict[str, Incomplete] | None = None,
|
||||
method: str = "average",
|
||||
|
||||
@@ -93,6 +93,7 @@ class RaggedFeature(NamedTuple):
|
||||
|
||||
class UniformRowLength(NamedTuple): # type: ignore[misc]
|
||||
length: int
|
||||
|
||||
dtype: DTypeLike
|
||||
value_key: str | None = ...
|
||||
partitions: tuple[RowSplits | RowLengths | RowStarts | RowLimits | ValueRowIds | UniformRowLength, ...] = ... # type: ignore[name-defined]
|
||||
|
||||
@@ -4,6 +4,7 @@ Tests for `dict.__(r)or__`.
|
||||
`dict.__or__` and `dict.__ror__` were only added in py39,
|
||||
hence why these are in a separate file to the other test cases for `dict`.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
|
||||
@@ -214,8 +214,7 @@ if sys.version_info >= (3, 11):
|
||||
|
||||
_BE = TypeVar("_BE", bound=BaseException)
|
||||
|
||||
class CustomBaseGroup(BaseExceptionGroup[_BE]):
|
||||
...
|
||||
class CustomBaseGroup(BaseExceptionGroup[_BE]): ...
|
||||
|
||||
cb1 = CustomBaseGroup("x", [SystemExit()])
|
||||
assert_type(cb1, CustomBaseGroup[SystemExit])
|
||||
@@ -276,8 +275,7 @@ if sys.version_info >= (3, 11):
|
||||
|
||||
_E = TypeVar("_E", bound=Exception)
|
||||
|
||||
class CustomGroup(ExceptionGroup[_E]):
|
||||
...
|
||||
class CustomGroup(ExceptionGroup[_E]): ...
|
||||
|
||||
CustomGroup("x", [SystemExit()]) # type: ignore
|
||||
cg1 = CustomGroup("x", [ValueError()])
|
||||
|
||||
@@ -54,12 +54,10 @@ round(WithCustomRound2()) # type: ignore
|
||||
|
||||
class WithOverloadedRound:
|
||||
@overload
|
||||
def __round__(self, ndigits: None = ...) -> str:
|
||||
...
|
||||
def __round__(self, ndigits: None = ...) -> str: ...
|
||||
|
||||
@overload
|
||||
def __round__(self, ndigits: int) -> bytes:
|
||||
...
|
||||
def __round__(self, ndigits: int) -> bytes: ...
|
||||
|
||||
def __round__(self, ndigits: int | None = None) -> str | bytes:
|
||||
return b"" if ndigits is None else ""
|
||||
|
||||
@@ -5,12 +5,10 @@ from concurrent.futures import Future, ThreadPoolExecutor, as_completed
|
||||
from typing_extensions import assert_type
|
||||
|
||||
|
||||
class Parent:
|
||||
...
|
||||
class Parent: ...
|
||||
|
||||
|
||||
class Child(Parent):
|
||||
...
|
||||
class Child(Parent): ...
|
||||
|
||||
|
||||
def check_as_completed_covariance() -> None:
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
These are all meant to be examples of idiomatic itertools usage,
|
||||
so they should all type-check without error.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import collections
|
||||
@@ -93,13 +94,11 @@ def consume(iterator: Iterator[object], n: int | None = None) -> None:
|
||||
|
||||
|
||||
@overload
|
||||
def nth(iterable: Iterable[_T], n: int, default: None = None) -> _T | None:
|
||||
...
|
||||
def nth(iterable: Iterable[_T], n: int, default: None = None) -> _T | None: ...
|
||||
|
||||
|
||||
@overload
|
||||
def nth(iterable: Iterable[_T], n: int, default: _T1) -> _T | _T1:
|
||||
...
|
||||
def nth(iterable: Iterable[_T], n: int, default: _T1) -> _T | _T1: ...
|
||||
|
||||
|
||||
def nth(iterable: Iterable[object], n: int, default: object = None) -> object:
|
||||
@@ -108,13 +107,11 @@ def nth(iterable: Iterable[object], n: int, default: object = None) -> object:
|
||||
|
||||
|
||||
@overload
|
||||
def quantify(iterable: Iterable[object]) -> int:
|
||||
...
|
||||
def quantify(iterable: Iterable[object]) -> int: ...
|
||||
|
||||
|
||||
@overload
|
||||
def quantify(iterable: Iterable[_T], pred: Callable[[_T], bool]) -> int:
|
||||
...
|
||||
def quantify(iterable: Iterable[_T], pred: Callable[[_T], bool]) -> int: ...
|
||||
|
||||
|
||||
def quantify(iterable: Iterable[object], pred: Callable[[Any], bool] = bool) -> int:
|
||||
@@ -125,13 +122,11 @@ def quantify(iterable: Iterable[object], pred: Callable[[Any], bool] = bool) ->
|
||||
@overload
|
||||
def first_true(
|
||||
iterable: Iterable[_T], default: Literal[False] = False, pred: Callable[[_T], bool] | None = None
|
||||
) -> _T | Literal[False]:
|
||||
...
|
||||
) -> _T | Literal[False]: ...
|
||||
|
||||
|
||||
@overload
|
||||
def first_true(iterable: Iterable[_T], default: _T1, pred: Callable[[_T], bool] | None = None) -> _T | _T1:
|
||||
...
|
||||
def first_true(iterable: Iterable[_T], default: _T1, pred: Callable[[_T], bool] | None = None) -> _T | _T1: ...
|
||||
|
||||
|
||||
def first_true(iterable: Iterable[object], default: object = False, pred: Callable[[Any], bool] | None = None) -> object:
|
||||
@@ -149,13 +144,13 @@ _ExceptionOrExceptionTuple: TypeAlias = Union[Type[BaseException], Tuple[Type[Ba
|
||||
|
||||
|
||||
@overload
|
||||
def iter_except(func: Callable[[], _T], exception: _ExceptionOrExceptionTuple, first: None = None) -> Iterator[_T]:
|
||||
...
|
||||
def iter_except(func: Callable[[], _T], exception: _ExceptionOrExceptionTuple, first: None = None) -> Iterator[_T]: ...
|
||||
|
||||
|
||||
@overload
|
||||
def iter_except(func: Callable[[], _T], exception: _ExceptionOrExceptionTuple, first: Callable[[], _T1]) -> Iterator[_T | _T1]:
|
||||
...
|
||||
def iter_except(
|
||||
func: Callable[[], _T], exception: _ExceptionOrExceptionTuple, first: Callable[[], _T1]
|
||||
) -> Iterator[_T | _T1]: ...
|
||||
|
||||
|
||||
def iter_except(
|
||||
@@ -253,13 +248,11 @@ def before_and_after(predicate: Callable[[_T], bool], it: Iterable[_T]) -> tuple
|
||||
|
||||
|
||||
@overload
|
||||
def unique_everseen(iterable: Iterable[_HashableT], key: None = None) -> Iterator[_HashableT]:
|
||||
...
|
||||
def unique_everseen(iterable: Iterable[_HashableT], key: None = None) -> Iterator[_HashableT]: ...
|
||||
|
||||
|
||||
@overload
|
||||
def unique_everseen(iterable: Iterable[_T], key: Callable[[_T], Hashable]) -> Iterator[_T]:
|
||||
...
|
||||
def unique_everseen(iterable: Iterable[_T], key: Callable[[_T], Hashable]) -> Iterator[_T]: ...
|
||||
|
||||
|
||||
def unique_everseen(iterable: Iterable[_T], key: Callable[[_T], Hashable] | None = None) -> Iterator[_T]:
|
||||
@@ -336,20 +329,17 @@ if sys.version_info >= (3, 10):
|
||||
@overload
|
||||
def grouper(
|
||||
iterable: Iterable[_T], n: int, *, incomplete: Literal["fill"] = "fill", fillvalue: None = None
|
||||
) -> Iterator[tuple[_T | None, ...]]:
|
||||
...
|
||||
) -> Iterator[tuple[_T | None, ...]]: ...
|
||||
|
||||
@overload
|
||||
def grouper(
|
||||
iterable: Iterable[_T], n: int, *, incomplete: Literal["fill"] = "fill", fillvalue: _T1
|
||||
) -> Iterator[tuple[_T | _T1, ...]]:
|
||||
...
|
||||
) -> Iterator[tuple[_T | _T1, ...]]: ...
|
||||
|
||||
@overload
|
||||
def grouper(
|
||||
iterable: Iterable[_T], n: int, *, incomplete: Literal["strict", "ignore"], fillvalue: None = None
|
||||
) -> Iterator[tuple[_T, ...]]:
|
||||
...
|
||||
) -> Iterator[tuple[_T, ...]]: ...
|
||||
|
||||
def grouper(
|
||||
iterable: Iterable[object], n: int, *, incomplete: Literal["fill", "strict", "ignore"] = "fill", fillvalue: object = None
|
||||
|
||||
Reference in New Issue
Block a user