diff --git a/.flake8 b/.flake8 index 5286e25d1..e07faf68f 100644 --- a/.flake8 +++ b/.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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 52d79a67b..60a26971a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/requirements-tests.txt b/requirements-tests.txt index c014b7bd4..84e0291ff 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -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 diff --git a/stdlib/_curses.pyi b/stdlib/_curses.pyi index adb09a50f..20189cb28 100644 --- a/stdlib/_curses.pyi +++ b/stdlib/_curses.pyi @@ -553,5 +553,6 @@ if sys.platform != "win32": major: int minor: int patch: int + ncurses_version: _ncurses_version window = _CursesWindow # undocumented diff --git a/stdlib/_msi.pyi b/stdlib/_msi.pyi index 160406a6d..22239cbff 100644 --- a/stdlib/_msi.pyi +++ b/stdlib/_msi.pyi @@ -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: ... diff --git a/stdlib/_thread.pyi b/stdlib/_thread.pyi index 8b43a81ca..ff9bd1a12 100644 --- a/stdlib/_thread.pyi +++ b/stdlib/_thread.pyi @@ -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 diff --git a/stdlib/asyncio/sslproto.pyi b/stdlib/asyncio/sslproto.pyi index 5dcca950e..b56b1547d 100644 --- a/stdlib/asyncio/sslproto.pyi +++ b/stdlib/asyncio/sslproto.pyi @@ -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: diff --git a/stdlib/asyncio/unix_events.pyi b/stdlib/asyncio/unix_events.pyi index d2a2fef5c..2fbc0a4e6 100644 --- a/stdlib/asyncio/unix_events.pyi +++ b/stdlib/asyncio/unix_events.pyi @@ -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: ... diff --git a/stdlib/asyncio/windows_events.pyi b/stdlib/asyncio/windows_events.pyi index fdf43d3ea..9c150ee16 100644 --- a/stdlib/asyncio/windows_events.pyi +++ b/stdlib/asyncio/windows_events.pyi @@ -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 diff --git a/stdlib/calendar.pyi b/stdlib/calendar.pyi index cac39a498..14d1d9075 100644 --- a/stdlib/calendar.pyi +++ b/stdlib/calendar.pyi @@ -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 diff --git a/stdlib/contextlib.pyi b/stdlib/contextlib.pyi index ce46d0d39..eb4e95b33 100644 --- a/stdlib/contextlib.pyi +++ b/stdlib/contextlib.pyi @@ -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]): diff --git a/stdlib/dbm/gnu.pyi b/stdlib/dbm/gnu.pyi index 3dc66a30c..0f818ed5e 100644 --- a/stdlib/dbm/gnu.pyi +++ b/stdlib/dbm/gnu.pyi @@ -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: ... diff --git a/stdlib/dbm/ndbm.pyi b/stdlib/dbm/ndbm.pyi index 1106fb2a8..a7a6d52d8 100644 --- a/stdlib/dbm/ndbm.pyi +++ b/stdlib/dbm/ndbm.pyi @@ -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: ... diff --git a/stdlib/enum.pyi b/stdlib/enum.pyi index 42d0c19d3..96cb2264e 100644 --- a/stdlib/enum.pyi +++ b/stdlib/enum.pyi @@ -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 diff --git a/stdlib/grp.pyi b/stdlib/grp.pyi index bb0d65180..965ecece2 100644 --- a/stdlib/grp.pyi +++ b/stdlib/grp.pyi @@ -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 diff --git a/stdlib/importlib/metadata/__init__.pyi b/stdlib/importlib/metadata/__init__.pyi index a936eece1..eb4db39eb 100644 --- a/stdlib/importlib/metadata/__init__.pyi +++ b/stdlib/importlib/metadata/__init__.pyi @@ -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): diff --git a/stdlib/inspect.pyi b/stdlib/inspect.pyi index a26dc67f9..06a8ff6a3 100644 --- a/stdlib/inspect.pyi +++ b/stdlib/inspect.pyi @@ -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): diff --git a/stdlib/msilib/__init__.pyi b/stdlib/msilib/__init__.pyi index 106805dab..3e43cbc44 100644 --- a/stdlib/msilib/__init__.pyi +++ b/stdlib/msilib/__init__.pyi @@ -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: diff --git a/stdlib/multiprocessing/reduction.pyi b/stdlib/multiprocessing/reduction.pyi index ad80169b4..91532633e 100644 --- a/stdlib/multiprocessing/reduction.pyi +++ b/stdlib/multiprocessing/reduction.pyi @@ -86,4 +86,5 @@ class AbstractReducer(metaclass=ABCMeta): sendfds = _sendfds recvfds = _recvfds DupFd = _DupFd + def __init__(self, *args: Unused) -> None: ... diff --git a/stdlib/os/__init__.pyi b/stdlib/os/__init__.pyi index 3b277460d..b57678635 100644 --- a/stdlib/os/__init__.pyi +++ b/stdlib/os/__init__.pyi @@ -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: ... diff --git a/stdlib/pstats.pyi b/stdlib/pstats.pyi index a6ffd54de..86f88da9e 100644 --- a/stdlib/pstats.pyi +++ b/stdlib/pstats.pyi @@ -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 diff --git a/stdlib/pwd.pyi b/stdlib/pwd.pyi index 64e831bce..9a8e1036e 100644 --- a/stdlib/pwd.pyi +++ b/stdlib/pwd.pyi @@ -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 diff --git a/stdlib/pyexpat/__init__.pyi b/stdlib/pyexpat/__init__.pyi index 92d926ebd..2188e4584 100644 --- a/stdlib/pyexpat/__init__.pyi +++ b/stdlib/pyexpat/__init__.pyi @@ -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 diff --git a/stdlib/resource.pyi b/stdlib/resource.pyi index 31c551113..f40e5ec1e 100644 --- a/stdlib/resource.pyi +++ b/stdlib/resource.pyi @@ -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 diff --git a/stdlib/select.pyi b/stdlib/select.pyi index f2cfc881c..afab88e18 100644 --- a/stdlib/select.pyi +++ b/stdlib/select.pyi @@ -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 diff --git a/stdlib/signal.pyi b/stdlib/signal.pyi index 910424c01..544473df9 100644 --- a/stdlib/signal.pyi +++ b/stdlib/signal.pyi @@ -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 diff --git a/stdlib/spwd.pyi b/stdlib/spwd.pyi index 93dfad3b3..d362a0b77 100644 --- a/stdlib/spwd.pyi +++ b/stdlib/spwd.pyi @@ -17,6 +17,7 @@ if sys.platform != "win32": "sp_expire", "sp_flag", ) + @property def sp_namp(self) -> str: ... @property diff --git a/stdlib/subprocess.pyi b/stdlib/subprocess.pyi index df1db5c82..a285608a2 100644 --- a/stdlib/subprocess.pyi +++ b/stdlib/subprocess.pyi @@ -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, diff --git a/stdlib/time.pyi b/stdlib/time.pyi index 28752bddc..b7962f075 100644 --- a/stdlib/time.pyi +++ b/stdlib/time.pyi @@ -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 diff --git a/stdlib/typing.pyi b/stdlib/typing.pyi index 9fef9d392..5d01be539 100644 --- a/stdlib/typing.pyi +++ b/stdlib/typing.pyi @@ -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. diff --git a/stdlib/unittest/result.pyi b/stdlib/unittest/result.pyi index dfc505936..436fabf20 100644 --- a/stdlib/unittest/result.pyi +++ b/stdlib/unittest/result.pyi @@ -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: ... diff --git a/stubs/Flask-Migrate/flask_migrate/__init__.pyi b/stubs/Flask-Migrate/flask_migrate/__init__.pyi index 388708e71..9014cd007 100644 --- a/stubs/Flask-Migrate/flask_migrate/__init__.pyi +++ b/stubs/Flask-Migrate/flask_migrate/__init__.pyi @@ -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: ... diff --git a/stubs/WTForms/@tests/test_cases/check_filters.py b/stubs/WTForms/@tests/test_cases/check_filters.py index 2786e3b20..26ad95554 100644 --- a/stubs/WTForms/@tests/test_cases/check_filters.py +++ b/stubs/WTForms/@tests/test_cases/check_filters.py @@ -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 diff --git a/stubs/boto/boto/utils.pyi b/stubs/boto/boto/utils.pyi index 6b61db28d..581955f1c 100644 --- a/stubs/boto/boto/utils.pyi +++ b/stubs/boto/boto/utils.pyi @@ -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 diff --git a/stubs/braintree/braintree/address.pyi b/stubs/braintree/braintree/address.pyi index bd6d26c7d..2657af69b 100644 --- a/stubs/braintree/braintree/address.pyi +++ b/stubs/braintree/braintree/address.pyi @@ -13,6 +13,7 @@ class Address(Resource): Ground: str Electronic: str ShipToStore: str + @staticmethod def create(params: Incomplete | None = None): ... @staticmethod diff --git a/stubs/braintree/braintree/apple_pay_card.pyi b/stubs/braintree/braintree/apple_pay_card.pyi index f1cf10754..792d2b4b6 100644 --- a/stubs/braintree/braintree/apple_pay_card.pyi +++ b/stubs/braintree/braintree/apple_pay_card.pyi @@ -7,6 +7,7 @@ class ApplePayCard(Resource): AmEx: str MasterCard: str Visa: str + is_expired: Any subscriptions: Any def __init__(self, gateway, attributes) -> None: ... diff --git a/stubs/braintree/braintree/credit_card.pyi b/stubs/braintree/braintree/credit_card.pyi index e406a2b3b..4957523f4 100644 --- a/stubs/braintree/braintree/credit_card.pyi +++ b/stubs/braintree/braintree/credit_card.pyi @@ -35,6 +35,7 @@ class CreditCard(Resource): Yes: str No: str Unknown: str + Commercial: Any DurbinRegulated: Any Debit: Any diff --git a/stubs/braintree/braintree/credit_card_verification.pyi b/stubs/braintree/braintree/credit_card_verification.pyi index 29fb9d5d1..e1672dd7b 100644 --- a/stubs/braintree/braintree/credit_card_verification.pyi +++ b/stubs/braintree/braintree/credit_card_verification.pyi @@ -12,6 +12,7 @@ class CreditCardVerification(AttributeGetter): GatewayRejected: str ProcessorDeclined: str Verified: str + amount: Any currency_iso_code: Any processor_response_code: Any diff --git a/stubs/braintree/braintree/disbursement.pyi b/stubs/braintree/braintree/disbursement.pyi index fc4634d3e..e167f4d36 100644 --- a/stubs/braintree/braintree/disbursement.pyi +++ b/stubs/braintree/braintree/disbursement.pyi @@ -8,6 +8,7 @@ class Disbursement(Resource): class Type: Credit: str Debit: str + amount: Any merchant_account: Any def __init__(self, gateway, attributes) -> None: ... diff --git a/stubs/braintree/braintree/dispute.pyi b/stubs/braintree/braintree/dispute.pyi index edda8a919..951c10f5e 100644 --- a/stubs/braintree/braintree/dispute.pyi +++ b/stubs/braintree/braintree/dispute.pyi @@ -40,6 +40,7 @@ class Dispute(AttributeGetter): Effortless: str Standard: str NotProtected: str + @staticmethod def accept(id): ... @staticmethod diff --git a/stubs/braintree/braintree/document_upload.pyi b/stubs/braintree/braintree/document_upload.pyi index 51d673dd3..9936d51c8 100644 --- a/stubs/braintree/braintree/document_upload.pyi +++ b/stubs/braintree/braintree/document_upload.pyi @@ -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 diff --git a/stubs/braintree/braintree/europe_bank_account.pyi b/stubs/braintree/braintree/europe_bank_account.pyi index 6c6230c5d..f8d94dcfa 100644 --- a/stubs/braintree/braintree/europe_bank_account.pyi +++ b/stubs/braintree/braintree/europe_bank_account.pyi @@ -5,5 +5,6 @@ class EuropeBankAccount(Resource): class MandateType: Business: str Consumer: str + @staticmethod def signature(): ... diff --git a/stubs/braintree/braintree/merchant_account/merchant_account.pyi b/stubs/braintree/braintree/merchant_account/merchant_account.pyi index 83e51e471..5c2c776bc 100644 --- a/stubs/braintree/braintree/merchant_account/merchant_account.pyi +++ b/stubs/braintree/braintree/merchant_account/merchant_account.pyi @@ -19,6 +19,7 @@ class MerchantAccount(Resource): Bank: str Email: str MobilePhone: str + FundingDestinations: Any individual_details: Any business_details: Any diff --git a/stubs/braintree/braintree/subscription.pyi b/stubs/braintree/braintree/subscription.pyi index 898794b0c..22838779f 100644 --- a/stubs/braintree/braintree/subscription.pyi +++ b/stubs/braintree/braintree/subscription.pyi @@ -30,6 +30,7 @@ class Subscription(Resource): Expired: str PastDue: str Pending: str + @staticmethod def create(params: Incomplete | None = None): ... @staticmethod diff --git a/stubs/braintree/braintree/transaction.pyi b/stubs/braintree/braintree/transaction.pyi index 23498bbf2..b57da28ae 100644 --- a/stubs/braintree/braintree/transaction.pyi +++ b/stubs/braintree/braintree/transaction.pyi @@ -97,6 +97,7 @@ class Transaction(Resource): Telephone: str Laundry: str Other: str + @staticmethod def adjust_authorization(transaction_id, amount): ... @staticmethod diff --git a/stubs/braintree/braintree/transaction_line_item.pyi b/stubs/braintree/braintree/transaction_line_item.pyi index 11cd731f7..8b85443b2 100644 --- a/stubs/braintree/braintree/transaction_line_item.pyi +++ b/stubs/braintree/braintree/transaction_line_item.pyi @@ -6,6 +6,7 @@ class TransactionLineItem(AttributeGetter): class Kind: Credit: str Debit: str + def __init__(self, attributes) -> None: ... @staticmethod def find_all(transaction_id): ... diff --git a/stubs/braintree/braintree/us_bank_account_verification.pyi b/stubs/braintree/braintree/us_bank_account_verification.pyi index 517d5ec40..641b9d5da 100644 --- a/stubs/braintree/braintree/us_bank_account_verification.pyi +++ b/stubs/braintree/braintree/us_bank_account_verification.pyi @@ -17,6 +17,7 @@ class UsBankAccountVerification(AttributeGetter): IndependentCheck: str TokenizedCheck: str MicroTransfers: str + us_bank_account: Any def __init__(self, gateway, attributes) -> None: ... @staticmethod diff --git a/stubs/braintree/braintree/util/http.pyi b/stubs/braintree/braintree/util/http.pyi index 970209c3b..1092cd250 100644 --- a/stubs/braintree/braintree/util/http.pyi +++ b/stubs/braintree/braintree/util/http.pyi @@ -27,6 +27,7 @@ class Http: Xml: str Multipart: str Json: str + @staticmethod def is_error_status(status): ... @staticmethod diff --git a/stubs/braintree/braintree/webhook_notification.pyi b/stubs/braintree/braintree/webhook_notification.pyi index 34de0f771..795ad4536 100644 --- a/stubs/braintree/braintree/webhook_notification.pyi +++ b/stubs/braintree/braintree/webhook_notification.pyi @@ -59,6 +59,7 @@ class WebhookNotification(Resource): TransactionDisbursed: str TransactionSettled: str TransactionSettlementDeclined: str + @staticmethod def parse(signature, payload): ... @staticmethod diff --git a/stubs/colorama/colorama/win32.pyi b/stubs/colorama/colorama/win32.pyi index 548feab0c..f1bcefe70 100644 --- a/stubs/colorama/colorama/win32.pyi +++ b/stubs/colorama/colorama/win32.pyi @@ -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: ... diff --git a/stubs/gevent/gevent/libuv/loop.pyi b/stubs/gevent/gevent/libuv/loop.pyi index ac06e6aec..e5d539acb 100644 --- a/stubs/gevent/gevent/libuv/loop.pyi +++ b/stubs/gevent/gevent/libuv/loop.pyi @@ -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: ... diff --git a/stubs/google-cloud-ndb/google/cloud/ndb/global_cache.pyi b/stubs/google-cloud-ndb/google/cloud/ndb/global_cache.pyi index 8a495a68c..3fca22af0 100644 --- a/stubs/google-cloud-ndb/google/cloud/ndb/global_cache.pyi +++ b/stubs/google-cloud-ndb/google/cloud/ndb/global_cache.pyi @@ -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: ... diff --git a/stubs/influxdb-client/influxdb_client/client/write_api.pyi b/stubs/influxdb-client/influxdb_client/client/write_api.pyi index 85bf6adde..28d52b732 100644 --- a/stubs/influxdb-client/influxdb_client/client/write_api.pyi +++ b/stubs/influxdb-client/influxdb_client/client/write_api.pyi @@ -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: ... diff --git a/stubs/influxdb-client/influxdb_client/client/write_api_async.pyi b/stubs/influxdb-client/influxdb_client/client/write_api_async.pyi index 365f5b7f7..87a8d8b9d 100644 --- a/stubs/influxdb-client/influxdb_client/client/write_api_async.pyi +++ b/stubs/influxdb-client/influxdb_client/client/write_api_async.pyi @@ -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: ... diff --git a/stubs/ldap3/ldap3/strategy/asynchronous.pyi b/stubs/ldap3/ldap3/strategy/asynchronous.pyi index a5509f8df..883c285af 100644 --- a/stubs/ldap3/ldap3/strategy/asynchronous.pyi +++ b/stubs/ldap3/ldap3/strategy/asynchronous.pyi @@ -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 diff --git a/stubs/ldap3/ldap3/strategy/reusable.pyi b/stubs/ldap3/ldap3/strategy/reusable.pyi index 8e26343bb..10413bcff 100644 --- a/stubs/ldap3/ldap3/strategy/reusable.pyi +++ b/stubs/ldap3/ldap3/strategy/reusable.pyi @@ -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 diff --git a/stubs/networkx/networkx/algorithms/tree/branchings.pyi b/stubs/networkx/networkx/algorithms/tree/branchings.pyi index 0758083b4..e60469f9d 100644 --- a/stubs/networkx/networkx/algorithms/tree/branchings.pyi +++ b/stubs/networkx/networkx/algorithms/tree/branchings.pyi @@ -71,6 +71,7 @@ class ArborescenceIterator: class Partition: mst_weight: float partition_dict: dict[Incomplete, Incomplete] + G: Incomplete weight: Incomplete minimum: Incomplete diff --git a/stubs/networkx/networkx/algorithms/tree/mst.pyi b/stubs/networkx/networkx/algorithms/tree/mst.pyi index 860063406..8f40029ff 100644 --- a/stubs/networkx/networkx/algorithms/tree/mst.pyi +++ b/stubs/networkx/networkx/algorithms/tree/mst.pyi @@ -34,6 +34,7 @@ class SpanningTreeIterator: class Partition: mst_weight: float partition_dict: dict[Incomplete, Incomplete] + G: Incomplete weight: Incomplete minimum: Incomplete diff --git a/stubs/openpyxl/openpyxl/chart/axis.pyi b/stubs/openpyxl/openpyxl/chart/axis.pyi index a724d9633..d11c8b2f1 100644 --- a/stubs/openpyxl/openpyxl/chart/axis.pyi +++ b/stubs/openpyxl/openpyxl/chart/axis.pyi @@ -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: ... diff --git a/stubs/openpyxl/openpyxl/packaging/custom.pyi b/stubs/openpyxl/openpyxl/packaging/custom.pyi index 46121a55b..a01a5a098 100644 --- a/stubs/openpyxl/openpyxl/packaging/custom.pyi +++ b/stubs/openpyxl/openpyxl/packaging/custom.pyi @@ -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] diff --git a/stubs/openpyxl/openpyxl/worksheet/worksheet.pyi b/stubs/openpyxl/openpyxl/worksheet/worksheet.pyi index d9a2b4a95..aaca8ac41 100644 --- a/stubs/openpyxl/openpyxl/worksheet/worksheet.pyi +++ b/stubs/openpyxl/openpyxl/worksheet/worksheet.pyi @@ -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: ... diff --git a/stubs/paramiko/paramiko/_winapi.pyi b/stubs/paramiko/paramiko/_winapi.pyi index cbfcff392..1577807f0 100644 --- a/stubs/paramiko/paramiko/_winapi.pyi +++ b/stubs/paramiko/paramiko/_winapi.pyi @@ -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 diff --git a/stubs/pika/pika/adapters/blocking_connection.pyi b/stubs/pika/pika/adapters/blocking_connection.pyi index 02097b5c4..1ca81beae 100644 --- a/stubs/pika/pika/adapters/blocking_connection.pyi +++ b/stubs/pika/pika/adapters/blocking_connection.pyi @@ -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): ... diff --git a/stubs/psutil/psutil/_psbsd.pyi b/stubs/psutil/psutil/_psbsd.pyi index fe5a54139..16895183f 100644 --- a/stubs/psutil/psutil/_psbsd.pyi +++ b/stubs/psutil/psutil/_psbsd.pyi @@ -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): ... diff --git a/stubs/psutil/psutil/_pssunos.pyi b/stubs/psutil/psutil/_pssunos.pyi index 22767c5f2..f5782aa0b 100644 --- a/stubs/psutil/psutil/_pssunos.pyi +++ b/stubs/psutil/psutil/_pssunos.pyi @@ -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): ... diff --git a/stubs/pyasn1/pyasn1/type/useful.pyi b/stubs/pyasn1/pyasn1/type/useful.pyi index 5d2ad64b3..559d7f084 100644 --- a/stubs/pyasn1/pyasn1/type/useful.pyi +++ b/stubs/pyasn1/pyasn1/type/useful.pyi @@ -15,6 +15,7 @@ class TimeMixIn: def utcoffset(self, dt): ... def tzname(self, dt): ... def dst(self, dt): ... + UTC: FixedOffset @property def asDateTime(self): ... diff --git a/stubs/pynput/pynput/_util.pyi b/stubs/pynput/pynput/_util.pyi index 85ee71e92..49658be67 100644 --- a/stubs/pynput/pynput/_util.pyi +++ b/stubs/pynput/pynput/_util.pyi @@ -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 diff --git a/stubs/pyserial/serial/tools/list_ports_windows.pyi b/stubs/pyserial/serial/tools/list_ports_windows.pyi index 9b00f7102..dc499e238 100644 --- a/stubs/pyserial/serial/tools/list_ports_windows.pyi +++ b/stubs/pyserial/serial/tools/list_ports_windows.pyi @@ -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 diff --git a/stubs/pyserial/serial/win32.pyi b/stubs/pyserial/serial/win32.pyi index d9d19b73c..0002114ac 100644 --- a/stubs/pyserial/serial/win32.pyi +++ b/stubs/pyserial/serial/win32.pyi @@ -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 diff --git a/stubs/seaborn/seaborn/matrix.pyi b/stubs/seaborn/seaborn/matrix.pyi index 7828fb6b3..d65a359c8 100644 --- a/stubs/seaborn/seaborn/matrix.pyi +++ b/stubs/seaborn/seaborn/matrix.pyi @@ -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", diff --git a/stubs/tensorflow/tensorflow/io/__init__.pyi b/stubs/tensorflow/tensorflow/io/__init__.pyi index 7ecbcb88e..a3dc24a1d 100644 --- a/stubs/tensorflow/tensorflow/io/__init__.pyi +++ b/stubs/tensorflow/tensorflow/io/__init__.pyi @@ -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] diff --git a/test_cases/stdlib/builtins/check_dict-py39.py b/test_cases/stdlib/builtins/check_dict-py39.py index 29e8f4b56..d707cfed2 100644 --- a/test_cases/stdlib/builtins/check_dict-py39.py +++ b/test_cases/stdlib/builtins/check_dict-py39.py @@ -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 diff --git a/test_cases/stdlib/builtins/check_exception_group-py311.py b/test_cases/stdlib/builtins/check_exception_group-py311.py index 49c10cede..e53cd1228 100644 --- a/test_cases/stdlib/builtins/check_exception_group-py311.py +++ b/test_cases/stdlib/builtins/check_exception_group-py311.py @@ -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()]) diff --git a/test_cases/stdlib/builtins/check_round.py b/test_cases/stdlib/builtins/check_round.py index 2648208bf..84081f366 100644 --- a/test_cases/stdlib/builtins/check_round.py +++ b/test_cases/stdlib/builtins/check_round.py @@ -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 "" diff --git a/test_cases/stdlib/check_concurrent_futures.py b/test_cases/stdlib/check_concurrent_futures.py index 2698a51f6..962ec23c6 100644 --- a/test_cases/stdlib/check_concurrent_futures.py +++ b/test_cases/stdlib/check_concurrent_futures.py @@ -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: diff --git a/test_cases/stdlib/itertools/check_itertools_recipes.py b/test_cases/stdlib/itertools/check_itertools_recipes.py index f64b0a096..c45ffee28 100644 --- a/test_cases/stdlib/itertools/check_itertools_recipes.py +++ b/test_cases/stdlib/itertools/check_itertools_recipes.py @@ -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