From a87bf935f3738e2a3df72a00756ba67e11e473f0 Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Thu, 9 Feb 2023 16:33:12 +0000 Subject: [PATCH 1/7] Codemod the `stubs/` directory --- .../DateTimeRange/datetimerange/__init__.pyi | 6 +- stubs/ExifRead/exifread/utils.pyi | 4 +- stubs/JACK-Client/jack/__init__.pyi | 4 +- stubs/Markdown/markdown/core.pyi | 4 +- stubs/Pillow/PIL/Image.pyi | 5 +- stubs/Pillow/PIL/ImageFile.pyi | 5 +- stubs/Pillow/PIL/ImageFilter.pyi | 7 +- stubs/PyMySQL/pymysql/connections.pyi | 5 +- stubs/PyMySQL/pymysql/cursors.pyi | 4 +- stubs/Pygments/pygments/token.pyi | 6 +- stubs/SQLAlchemy/sqlalchemy/engine/base.pyi | 5 +- stubs/SQLAlchemy/sqlalchemy/engine/mock.pyi | 4 +- stubs/SQLAlchemy/sqlalchemy/engine/result.pyi | 7 +- stubs/SQLAlchemy/sqlalchemy/engine/url.pyi | 15 +++-- stubs/SQLAlchemy/sqlalchemy/engine/util.pyi | 4 +- .../sqlalchemy/ext/asyncio/session.pyi | 5 +- stubs/SQLAlchemy/sqlalchemy/log.pyi | 4 +- stubs/SQLAlchemy/sqlalchemy/orm/query.pyi | 65 ++++++++++--------- stubs/SQLAlchemy/sqlalchemy/orm/session.pyi | 5 +- stubs/SQLAlchemy/sqlalchemy/sql/base.pyi | 7 +- stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi | 5 +- .../SQLAlchemy/sqlalchemy/sql/selectable.pyi | 57 ++++++++-------- .../sqlalchemy/util/_collections.pyi | 15 +++-- .../sqlalchemy/util/langhelpers.pyi | 9 +-- stubs/aiofiles/aiofiles/base.pyi | 4 +- .../aws_xray_sdk/core/models/trace_header.pyi | 4 +- stubs/beautifulsoup4/bs4/__init__.pyi | 5 +- stubs/beautifulsoup4/bs4/element.pyi | 17 ++--- stubs/caldav/caldav/davclient.pyi | 4 +- stubs/caldav/caldav/elements/base.pyi | 7 +- stubs/caldav/caldav/objects.pyi | 15 +++-- .../click-spinner/click_spinner/__init__.pyi | 4 +- stubs/croniter/croniter/croniter.pyi | 5 +- stubs/dateparser/dateparser/conf.pyi | 5 +- stubs/docutils/docutils/__init__.pyi | 4 +- stubs/docutils/docutils/nodes.pyi | 23 +++---- stubs/entrypoints/entrypoints.pyi | 6 +- stubs/fpdf2/fpdf/drawing.pyi | 51 ++++++++------- stubs/fpdf2/fpdf/enums.pyi | 6 +- .../google/cloud/ndb/global_cache.pyi | 7 +- .../google/cloud/ndb/model.pyi | 8 +-- stubs/httplib2/httplib2/__init__.pyi | 5 +- stubs/ibm-db/ibm_db.pyi | 10 +-- .../client/flux_csv_parser.pyi | 7 +- .../client/influxdb_client.pyi | 5 +- .../client/influxdb_client_async.pyi | 5 +- .../influxdb_client/client/write/point.pyi | 9 +-- stubs/invoke/invoke/tasks.pyi | 5 +- stubs/jsonschema/jsonschema/exceptions.pyi | 5 +- stubs/ldap3/ldap3/core/connection.pyi | 5 +- stubs/ldap3/ldap3/core/exceptions.pyi | 5 +- stubs/mock/mock/mock.pyi | 9 +-- stubs/mypy-extensions/mypy_extensions.pyi | 11 ++-- stubs/mysqlclient/MySQLdb/connections.pyi | 4 +- stubs/netaddr/netaddr/eui/__init__.pyi | 6 +- stubs/netaddr/netaddr/ip/__init__.pyi | 41 ++++++------ stubs/netaddr/netaddr/ip/sets.pyi | 6 +- .../opentracing/mocktracer/context.pyi | 4 +- .../opentracing/mocktracer/span.pyi | 10 +-- stubs/opentracing/opentracing/scope.pyi | 4 +- stubs/opentracing/opentracing/span.pyi | 17 ++--- stubs/paramiko/paramiko/_winapi.pyi | 5 +- stubs/paramiko/paramiko/config.pyi | 8 +-- stubs/paramiko/paramiko/hostkeys.pyi | 4 +- stubs/paramiko/paramiko/pkey.pyi | 12 ++-- stubs/paramiko/paramiko/sftp_attr.pyi | 4 +- stubs/paramiko/paramiko/sftp_client.pyi | 4 +- stubs/paramiko/paramiko/util.pyi | 4 +- .../parsimonious/parsimonious/expressions.pyi | 4 +- stubs/passlib/passlib/context.pyi | 7 +- stubs/passlib/passlib/handlers/pbkdf2.pyi | 4 +- stubs/passlib/passlib/handlers/phpass.pyi | 4 +- stubs/passlib/passlib/handlers/sha1_crypt.pyi | 4 +- stubs/passlib/passlib/handlers/sha2_crypt.pyi | 4 +- .../passlib/handlers/sun_md5_crypt.pyi | 4 +- stubs/passlib/passlib/ifc.pyi | 4 +- stubs/passlib/passlib/utils/handlers.pyi | 9 +-- stubs/peewee/peewee.pyi | 5 +- .../pika/pika/adapters/asyncio_connection.pyi | 5 +- stubs/pika/pika/adapters/base_connection.pyi | 5 +- .../pika/adapters/blocking_connection.pyi | 5 +- stubs/pika/pika/channel.pyi | 5 +- stubs/pika/pika/connection.pyi | 15 +++-- stubs/pika/pika/spec.pyi | 9 +-- stubs/protobuf/google/protobuf/message.pyi | 10 +-- stubs/psutil/psutil/__init__.pyi | 5 +- stubs/psycopg2/psycopg2/_psycopg.pyi | 8 +-- stubs/pyRFC3339/pyrfc3339/utils.pyi | 4 +- stubs/pyasn1/pyasn1/type/univ.pyi | 7 +- stubs/pycurl/pycurl.pyi | 5 +- .../PyInstaller/isolated/_parent.pyi | 4 +- stubs/pynput/pynput/_util.pyi | 8 +-- stubs/pynput/pynput/keyboard/_base.pyi | 10 +-- stubs/pynput/pynput/mouse/_base.pyi | 4 +- stubs/pyserial/serial/threaded/__init__.pyi | 5 +- stubs/pyserial/serial/tools/miniterm.pyi | 4 +- stubs/pysftp/pysftp/__init__.pyi | 4 +- stubs/python-crontab/cronlog.pyi | 5 +- stubs/python-crontab/crontab.pyi | 9 +-- stubs/python-dateutil/dateutil/_common.pyi | 4 +- .../dateutil/relativedelta.pyi | 22 +++---- stubs/python-jose/jose/backends/base.pyi | 4 +- .../jose/backends/ecdsa_backend.pyi | 4 +- .../python-jose/jose/backends/rsa_backend.pyi | 4 +- stubs/pywin32/_win32typing.pyi | 5 +- stubs/redis/redis/asyncio/client.pyi | 13 ++-- stubs/redis/redis/asyncio/cluster.pyi | 23 +++---- stubs/redis/redis/asyncio/lock.pyi | 4 +- stubs/redis/redis/client.pyi | 7 +- stubs/redis/redis/cluster.pyi | 7 +- stubs/redis/redis/connection.pyi | 5 +- stubs/redis/redis/lock.pyi | 5 +- stubs/regex/regex/_regex.pyi | 6 +- stubs/regex/regex/regex.pyi | 11 ++-- stubs/requests/requests/models.pyi | 4 +- stubs/requests/requests/sessions.pyi | 5 +- stubs/setuptools/pkg_resources/__init__.pyi | 5 +- .../setuptools/_distutils/version.pyi | 18 ++--- stubs/setuptools/setuptools/command/test.pyi | 5 +- stubs/slumber/slumber/__init__.pyi | 6 +- .../api_resources/abstract/api_resource.pyi | 7 +- .../abstract/createable_api_resource.pyi | 5 +- .../abstract/deletable_api_resource.pyi | 4 +- .../abstract/searchable_api_resource.pyi | 6 +- .../abstract/updateable_api_resource.pyi | 6 +- .../api_resources/application_fee_refund.pyi | 5 +- stubs/stripe/stripe/api_resources/invoice.pyi | 13 ++-- .../stripe/api_resources/payment_method.pyi | 6 +- .../api_resources/search_result_object.pyi | 8 +-- .../api_resources/test_helpers/test_clock.pyi | 4 +- stubs/stripe/stripe/stripe_object.pyi | 5 +- stubs/tensorflow/tensorflow/__init__.pyi | 5 +- stubs/toml/toml/tz.pyi | 4 +- stubs/tqdm/tqdm/asyncio.pyi | 5 +- stubs/tqdm/tqdm/dask.pyi | 5 +- stubs/tqdm/tqdm/std.pyi | 7 +- stubs/untangle/untangle.pyi | 4 +- stubs/urllib3/urllib3/connectionpool.pyi | 4 +- stubs/urllib3/urllib3/response.pyi | 4 +- stubs/urllib3/urllib3/util/retry.pyi | 4 +- 140 files changed, 591 insertions(+), 518 deletions(-) diff --git a/stubs/DateTimeRange/datetimerange/__init__.pyi b/stubs/DateTimeRange/datetimerange/__init__.pyi index ec530c724257..4978cc501af2 100644 --- a/stubs/DateTimeRange/datetimerange/__init__.pyi +++ b/stubs/DateTimeRange/datetimerange/__init__.pyi @@ -1,5 +1,5 @@ +from typing_extensions import Self import datetime -from _typeshed import Self from collections.abc import Iterable from typing import ClassVar @@ -33,9 +33,9 @@ class DateTimeRange: def __eq__(self, other: object) -> bool: ... def __ne__(self, other: object) -> bool: ... def __add__(self, other: datetime.timedelta) -> DateTimeRange: ... - def __iadd__(self: Self, other: datetime.timedelta) -> Self: ... + def __iadd__(self, other: datetime.timedelta) -> Self: ... def __sub__(self, other: datetime.timedelta) -> DateTimeRange: ... - def __isub__(self: Self, other: datetime.timedelta) -> Self: ... + def __isub__(self, other: datetime.timedelta) -> Self: ... def __contains__(self, x: datetime.timedelta | datetime.datetime | DateTimeRange | str) -> bool: ... @property def start_datetime(self) -> datetime.datetime: ... diff --git a/stubs/ExifRead/exifread/utils.pyi b/stubs/ExifRead/exifread/utils.pyi index 878c3adfac1a..5b0b09f8e54b 100644 --- a/stubs/ExifRead/exifread/utils.pyi +++ b/stubs/ExifRead/exifread/utils.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from collections.abc import Mapping from fractions import Fraction from typing import Any, TypeVar, overload @@ -14,7 +14,7 @@ def make_string_uc(seq: str | list[int]) -> str: ... def get_gps_coords(tags: Mapping[str, Any]) -> tuple[float, float]: ... class Ratio(Fraction): - def __new__(cls: type[Self], numerator: int = ..., denominator: int | None = ...) -> Self: ... + def __new__(cls, numerator: int = ..., denominator: int | None = ...) -> Self: ... @property def num(self) -> int: ... @property diff --git a/stubs/JACK-Client/jack/__init__.pyi b/stubs/JACK-Client/jack/__init__.pyi index 8a904b7c75c7..2057024ef443 100644 --- a/stubs/JACK-Client/jack/__init__.pyi +++ b/stubs/JACK-Client/jack/__init__.pyi @@ -1,5 +1,5 @@ +from typing_extensions import Self import sys -from _typeshed import Self from collections.abc import Callable, Generator, Iterable, Iterator, Sequence from typing import Any, NoReturn, overload from typing_extensions import Literal @@ -80,7 +80,7 @@ class Client: servername: str | None = ..., session_id: str | None = ..., ) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, *args: object) -> None: ... @property def name(self) -> str: ... diff --git a/stubs/Markdown/markdown/core.pyi b/stubs/Markdown/markdown/core.pyi index 96aa61a37d5f..25843d76e794 100644 --- a/stubs/Markdown/markdown/core.pyi +++ b/stubs/Markdown/markdown/core.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from collections.abc import Callable, Mapping, Sequence from typing import Any, ClassVar, Protocol from typing_extensions import Literal @@ -45,7 +45,7 @@ class Markdown: def registerExtensions(self, extensions: Sequence[Extension | str], configs: Mapping[str, Mapping[str, Any]]) -> Markdown: ... def build_extension(self, ext_name: str, configs: Mapping[str, str]) -> Extension: ... def registerExtension(self, extension: Extension) -> Markdown: ... - def reset(self: Self) -> Self: ... + def reset(self) -> Self: ... def set_output_format(self, format: Literal["xhtml", "html"]) -> Markdown: ... def is_block_level(self, tag: str) -> bool: ... def convert(self, source: str) -> str: ... diff --git a/stubs/Pillow/PIL/Image.pyi b/stubs/Pillow/PIL/Image.pyi index 7ea7e46f7213..4389a0608b06 100644 --- a/stubs/Pillow/PIL/Image.pyi +++ b/stubs/Pillow/PIL/Image.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self, SupportsRead, SupportsWrite +from typing_extensions import Self +from _typeshed import Incomplete, SupportsRead, SupportsWrite from collections.abc import Callable, Iterable, Iterator, MutableMapping, Sequence from enum import IntEnum from pathlib import Path @@ -171,7 +172,7 @@ class Image: def height(self) -> int: ... @property def size(self) -> tuple[int, int]: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, *args: object) -> None: ... def close(self) -> None: ... def __eq__(self, other: object) -> bool: ... diff --git a/stubs/Pillow/PIL/ImageFile.pyi b/stubs/Pillow/PIL/ImageFile.pyi index 678b045083f5..411e1f53589c 100644 --- a/stubs/Pillow/PIL/ImageFile.pyi +++ b/stubs/Pillow/PIL/ImageFile.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from typing import Any, NoReturn from .Image import Image @@ -40,7 +41,7 @@ class Parser: def reset(self) -> None: ... decode: Any def feed(self, data) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, *args: object) -> None: ... def close(self) -> Image: ... diff --git a/stubs/Pillow/PIL/ImageFilter.pyi b/stubs/Pillow/PIL/ImageFilter.pyi index 1182f89adc21..53f7ef633493 100644 --- a/stubs/Pillow/PIL/ImageFilter.pyi +++ b/stubs/Pillow/PIL/ImageFilter.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from collections.abc import Callable, Iterable, Sequence from typing import Any from typing_extensions import Literal, TypeAlias @@ -122,14 +123,14 @@ class Color3DLUT(MultibandFilter): ) -> None: ... @classmethod def generate( - cls: type[Self], + cls, size: int | tuple[int, int, int], callback: Callable[[float, float, float], Iterable[float]], channels: int = ..., target_mode: str | None = ..., ) -> Self: ... def transform( - self: Self, + self, callback: Callable[..., Iterable[float]], with_normals: bool = ..., channels: Literal[3, 4] | None = ..., diff --git a/stubs/PyMySQL/pymysql/connections.pyi b/stubs/PyMySQL/pymysql/connections.pyi index 5cf640bf366d..e71426008aff 100644 --- a/stubs/PyMySQL/pymysql/connections.pyi +++ b/stubs/PyMySQL/pymysql/connections.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from collections.abc import Mapping from socket import socket as _socket from typing import Any, AnyStr, Generic, TypeVar, overload @@ -197,7 +198,7 @@ class Connection(Generic[_C]): def get_proto_info(self): ... def get_server_info(self): ... def show_warnings(self): ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, *exc_info: object) -> None: ... Warning: Any Error: Any diff --git a/stubs/PyMySQL/pymysql/cursors.pyi b/stubs/PyMySQL/pymysql/cursors.pyi index df03886315da..a005b52a9cc8 100644 --- a/stubs/PyMySQL/pymysql/cursors.pyi +++ b/stubs/PyMySQL/pymysql/cursors.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from collections.abc import Iterable, Iterator from typing import Any @@ -24,7 +24,7 @@ class Cursor: def executemany(self, query: str, args: Iterable[object]) -> int | None: ... def callproc(self, procname: str, args: Iterable[Any] = ...) -> Any: ... def scroll(self, value: int, mode: str = ...) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, *exc_info: object) -> None: ... # Methods returning result tuples are below. def fetchone(self) -> tuple[Any, ...] | None: ... diff --git a/stubs/Pygments/pygments/token.pyi b/stubs/Pygments/pygments/token.pyi index 9fb24b751762..f24e58842c5f 100644 --- a/stubs/Pygments/pygments/token.pyi +++ b/stubs/Pygments/pygments/token.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from collections.abc import Mapping from typing import Any @@ -8,8 +8,8 @@ class _TokenType(tuple[str, ...]): subtypes: set[_TokenType] def __contains__(self, val: _TokenType) -> bool: ... # type: ignore[override] def __getattr__(self, name: str) -> _TokenType: ... - def __copy__(self: Self) -> Self: ... - def __deepcopy__(self: Self, memo: Any) -> Self: ... + def __copy__(self) -> Self: ... + def __deepcopy__(self, memo: Any) -> Self: ... Token: _TokenType Text: _TokenType diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi index 79013d653491..59dc6fc7fa3e 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from _typeshed.dbapi import DBAPIConnection from abc import abstractmethod from collections.abc import Callable, Mapping @@ -40,7 +41,7 @@ class Connection(Connectable): _allow_revalidate: bool = ..., ) -> None: ... def schema_for_object(self, obj) -> str | None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, type_: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/mock.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/mock.pyi index dc685760d8c0..c9de41730472 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/mock.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/mock.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from abc import abstractmethod from collections.abc import Mapping from typing import Any, overload @@ -11,7 +11,7 @@ from .url import URL class MockConnection(Connectable): def __init__(self, dialect: Dialect, execute) -> None: ... @property - def engine(self: Self) -> Self: ... # type: ignore[override] + def engine(self) -> Self: ... # type: ignore[override] @property def dialect(self) -> Dialect: ... @property diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi index c3fb605ae078..4194d913cabb 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from collections.abc import Generator, KeysView from typing import Any @@ -38,8 +39,8 @@ class _WithKeys: class Result(_WithKeys, ResultInternal): def __init__(self, cursor_metadata) -> None: ... def close(self) -> None: ... - def yield_per(self: Self, num: int) -> Self: ... - def unique(self: Self, strategy: Incomplete | None = ...) -> Self: ... + def yield_per(self, num: int) -> Self: ... + def unique(self, strategy: Incomplete | None = ...) -> Self: ... def columns(self, *col_expressions): ... def scalars(self, index: int = ...) -> ScalarResult: ... def mappings(self) -> MappingResult: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi index 30625dfcec8a..f3dcbc07afa2 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi @@ -1,4 +1,5 @@ -from _typeshed import Self, SupportsItems +from typing_extensions import Self +from _typeshed import SupportsItems from collections.abc import Iterable, Mapping, Sequence from typing import Any, NamedTuple from typing_extensions import TypeAlias @@ -31,7 +32,7 @@ class URL(_URLTuple): query: _Query | None = ..., ) -> URL: ... def set( - self: Self, + self, drivername: str | None = ..., username: str | None = ..., password: str | object | None = ..., @@ -40,16 +41,16 @@ class URL(_URLTuple): database: str | None = ..., query: _Query | None = ..., ) -> Self: ... - def update_query_string(self: Self, query_string: str, append: bool = ...) -> Self: ... - def update_query_pairs(self: Self, key_value_pairs: Iterable[tuple[str, str]], append: bool = ...) -> Self: ... - def update_query_dict(self: Self, query_parameters: SupportsItems[str, str | Sequence[str]], append: bool = ...) -> Self: ... + def update_query_string(self, query_string: str, append: bool = ...) -> Self: ... + def update_query_pairs(self, key_value_pairs: Iterable[tuple[str, str]], append: bool = ...) -> Self: ... + def update_query_dict(self, query_parameters: SupportsItems[str, str | Sequence[str]], append: bool = ...) -> Self: ... def difference_update_query(self, names: Iterable[str]) -> URL: ... @property def normalized_query(self) -> immutabledict[str, tuple[str, ...]]: ... def __to_string__(self, hide_password: bool = ...) -> str: ... def render_as_string(self, hide_password: bool = ...) -> str: ... - def __copy__(self: Self) -> Self: ... - def __deepcopy__(self: Self, memo: object) -> Self: ... + def __copy__(self) -> Self: ... + def __deepcopy__(self, memo: object) -> Self: ... def __hash__(self) -> int: ... def __eq__(self, other: object) -> bool: ... def __ne__(self, other: object) -> bool: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/util.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/util.pyi index f711f0c83d0a..38d001341bdc 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/util.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/util.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from collections.abc import Callable from types import TracebackType from typing import Any @@ -6,7 +6,7 @@ from typing import Any def connection_memoize(key: str) -> Callable[..., Any]: ... class TransactionalContext: - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, type_: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi index da62a7d9d6a3..3babfc8edbde 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from typing import Any from ...util import memoized_property @@ -53,7 +54,7 @@ class AsyncSession(ReversibleProxy): async def close(self): ... @classmethod async def close_all(cls): ... - async def __aenter__(self: Self) -> Self: ... + async def __aenter__(self) -> Self: ... async def __aexit__(self, type_, value, traceback) -> None: ... # proxied from Session identity_map: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/log.pyi b/stubs/SQLAlchemy/sqlalchemy/log.pyi index 54b045cbc314..d00fba81addb 100644 --- a/stubs/SQLAlchemy/sqlalchemy/log.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/log.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from logging import Logger from typing import Any, TypeVar, overload from typing_extensions import Literal, TypeAlias @@ -33,7 +33,7 @@ def instance_logger(instance: Identified, echoflag: _EchoFlag = ...) -> None: .. class echo_property: __doc__: str @overload - def __get__(self: Self, instance: None, owner: object) -> Self: ... + def __get__(self, instance: None, owner: object) -> Self: ... @overload def __get__(self, instance: Identified, owner: object) -> _EchoFlag: ... def __set__(self, instance: Identified, value: _EchoFlag) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi index 1e643cb7720d..8f90f6351cd7 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from collections.abc import Iterator from typing import Any, Generic, TypeVar from typing_extensions import Literal, TypeAlias @@ -30,74 +31,74 @@ class Query(_SelectFromElements, SupportsCloneAnnotations, HasPrefixes, HasSuffi @property def selectable(self): ... def __clause_element__(self): ... - def only_return_tuples(self: Self, value) -> Self: ... + def only_return_tuples(self, value) -> Self: ... @property def is_single_entity(self): ... - def enable_eagerloads(self: Self, value) -> Self: ... + def enable_eagerloads(self, value) -> Self: ... def with_labels(self): ... apply_labels: Any @property def get_label_style(self): ... def set_label_style(self, style): ... - def enable_assertions(self: Self, value) -> Self: ... + def enable_assertions(self, value) -> Self: ... @property def whereclause(self): ... def with_polymorphic( - self: Self, cls_or_mappers, selectable: Incomplete | None = ..., polymorphic_on: Incomplete | None = ... + self, cls_or_mappers, selectable: Incomplete | None = ..., polymorphic_on: Incomplete | None = ... ) -> Self: ... - def yield_per(self: Self, count) -> Self: ... + def yield_per(self, count) -> Self: ... def get(self, ident): ... @property def lazy_loaded_from(self): ... - def correlate(self: Self, *fromclauses) -> Self: ... - def autoflush(self: Self, setting) -> Self: ... - def populate_existing(self: Self) -> Self: ... + def correlate(self, *fromclauses) -> Self: ... + def autoflush(self, setting) -> Self: ... + def populate_existing(self) -> Self: ... def with_parent(self, instance, property: Incomplete | None = ..., from_entity: Incomplete | None = ...): ... - def add_entity(self: Self, entity, alias: Incomplete | None = ...) -> Self: ... - def with_session(self: Self, session) -> Self: ... + def add_entity(self, entity, alias: Incomplete | None = ...) -> Self: ... + def with_session(self, session) -> Self: ... def from_self(self, *entities): ... def values(self, *columns): ... def value(self, column): ... - def with_entities(self: Self, *entities) -> Self: ... - def add_columns(self: Self, *column) -> Self: ... + def with_entities(self, *entities) -> Self: ... + def add_columns(self, *column) -> Self: ... def add_column(self, column): ... - def options(self: Self, *args) -> Self: ... + def options(self, *args) -> Self: ... def with_transformation(self, fn): ... def get_execution_options(self): ... - def execution_options(self: Self, **kwargs) -> Self: ... + def execution_options(self, **kwargs) -> Self: ... def with_for_update( - self: Self, + self, read: bool = ..., nowait: bool = ..., of: Incomplete | None = ..., skip_locked: bool = ..., key_share: bool = ..., ) -> Self: ... - def params(self: Self, *args, **kwargs) -> Self: ... + def params(self, *args, **kwargs) -> Self: ... def where(self, *criterion): ... - def filter(self: Self, *criterion) -> Self: ... - def filter_by(self: Self, **kwargs) -> Self: ... - def order_by(self: Self, *clauses) -> Self: ... - def group_by(self: Self, *clauses) -> Self: ... - def having(self: Self, criterion) -> Self: ... + def filter(self, *criterion) -> Self: ... + def filter_by(self, **kwargs) -> Self: ... + def order_by(self, *clauses) -> Self: ... + def group_by(self, *clauses) -> Self: ... + def having(self, criterion) -> Self: ... def union(self, *q): ... def union_all(self, *q): ... def intersect(self, *q): ... def intersect_all(self, *q): ... def except_(self, *q): ... def except_all(self, *q): ... - def join(self: Self, target, *props, **kwargs) -> Self: ... - def outerjoin(self: Self, target, *props, **kwargs) -> Self: ... - def reset_joinpoint(self: Self) -> Self: ... - def select_from(self: Self, *from_obj) -> Self: ... - def select_entity_from(self: Self, from_obj) -> Self: ... + def join(self, target, *props, **kwargs) -> Self: ... + def outerjoin(self, target, *props, **kwargs) -> Self: ... + def reset_joinpoint(self) -> Self: ... + def select_from(self, *from_obj) -> Self: ... + def select_entity_from(self, from_obj) -> Self: ... def __getitem__(self, item): ... - def slice(self: Self, start, stop) -> Self: ... - def limit(self: Self, limit) -> Self: ... - def offset(self: Self, offset) -> Self: ... - def distinct(self: Self, *expr) -> Self: ... + def slice(self, start, stop) -> Self: ... + def limit(self, limit) -> Self: ... + def offset(self, offset) -> Self: ... + def distinct(self, *expr) -> Self: ... def all(self) -> list[_T]: ... - def from_statement(self: Self, statement) -> Self: ... + def from_statement(self, statement) -> Self: ... def first(self) -> _T | None: ... def one_or_none(self): ... def one(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi index f5ca6a284fb3..da35218ef1ab 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from collections.abc import Mapping from typing import Any, TypeVar, overload @@ -105,7 +106,7 @@ class Session(_SessionClassMethods): query_cls: Incomplete | None = ..., ) -> None: ... connection_callable: Any - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, type_, value, traceback) -> None: ... @property def transaction(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi index 54b1d90ee954..59e0773a8259 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from collections.abc import MutableMapping from typing import Any, ClassVar @@ -98,8 +99,8 @@ class Executable(roles.StatementRole, Generative): is_text: bool is_delete: bool is_dml: bool - def options(self: Self, *options) -> Self: ... - def execution_options(self: Self, **kw) -> Self: ... + def options(self, *options) -> Self: ... + def execution_options(self, **kw) -> Self: ... def get_execution_options(self): ... def execute(self, *multiparams, **params): ... def scalar(self, *multiparams, **params): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi index b6a4034d2efb..1cd13e081a61 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from typing import Any, Generic, TypeVar from typing_extensions import Literal @@ -138,7 +139,7 @@ class TextClause( key: Any text: Any def __init__(self, text: str, bind: Incomplete | None = None) -> None: ... - def bindparams(self: Self, *binds, **names_to_values) -> Self: ... + def bindparams(self, *binds, **names_to_values) -> Self: ... def columns(self, *cols, **types): ... @property def type(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi index cdf9bf417aa5..1d350a4e0207 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from typing import Any from .. import util @@ -38,14 +39,14 @@ class Selectable(ReturnsRows): def corresponding_column(self, column, require_embedded: bool = ...): ... class HasPrefixes: - def prefix_with(self: Self, *expr, **kw) -> Self: ... + def prefix_with(self, *expr, **kw) -> Self: ... class HasSuffixes: - def suffix_with(self: Self, *expr, **kw) -> Self: ... + def suffix_with(self, *expr, **kw) -> Self: ... class HasHints: def with_statement_hint(self, text, dialect_name: str = ...): ... - def with_hint(self: Self, selectable, text: str, dialect_name: str = ...) -> Self: ... + def with_hint(self, selectable, text: str, dialect_name: str = ...) -> Self: ... class FromClause(roles.AnonymizedFromClauseRole, Selectable): __visit_name__: str @@ -191,9 +192,9 @@ class Values(Generative, FromClause): name: Any literal_binds: Any def __init__(self, *columns, **kw) -> None: ... - def alias(self: Self, name: Incomplete | None, **kw) -> Self: ... # type: ignore[override] - def lateral(self: Self, name: Incomplete | None = ...) -> Self: ... - def data(self: Self, values) -> Self: ... + def alias(self, name: Incomplete | None, **kw) -> Self: ... # type: ignore[override] + def lateral(self, name: Incomplete | None = ...) -> Self: ... + def data(self, values) -> Self: ... class SelectBase( roles.SelectStatementRole, @@ -251,7 +252,7 @@ class GenerativeSelect(DeprecatedSelectBaseGenerations, SelectBase): bind: Incomplete | None = ..., ) -> None: ... def with_for_update( - self: Self, + self, nowait: bool = ..., read: bool = ..., of: Incomplete | None = ..., @@ -261,12 +262,12 @@ class GenerativeSelect(DeprecatedSelectBaseGenerations, SelectBase): def get_label_style(self): ... def set_label_style(self, style): ... def apply_labels(self): ... - def limit(self: Self, limit: Incomplete | None) -> Self: ... - def fetch(self: Self, count: Incomplete | None, with_ties: bool = ..., percent: bool = ...) -> Self: ... - def offset(self: Self, offset: Incomplete | None) -> Self: ... - def slice(self: Self, start: Incomplete | None, stop: Incomplete | None) -> Self: ... - def order_by(self: Self, *clauses) -> Self: ... - def group_by(self: Self, *clauses) -> Self: ... + def limit(self, limit: Incomplete | None) -> Self: ... + def fetch(self, count: Incomplete | None, with_ties: bool = ..., percent: bool = ...) -> Self: ... + def offset(self, offset: Incomplete | None) -> Self: ... + def slice(self, start: Incomplete | None, stop: Incomplete | None) -> Self: ... + def order_by(self, *clauses) -> Self: ... + def group_by(self, *clauses) -> Self: ... class CompoundSelectState(CompileState): ... @@ -344,10 +345,10 @@ class Select( @property def column_descriptions(self): ... def from_statement(self, statement): ... - def join(self: Self, target, onclause: Incomplete | None = ..., isouter: bool = ..., full: bool = ...) -> Self: ... + def join(self, target, onclause: Incomplete | None = ..., isouter: bool = ..., full: bool = ...) -> Self: ... def outerjoin_from(self, from_, target, onclause: Incomplete | None = ..., full: bool = ...): ... def join_from( - self: Self, from_, target, onclause: Incomplete | None = ..., isouter: bool = ..., full: bool = ... + self, from_, target, onclause: Incomplete | None = ..., isouter: bool = ..., full: bool = ... ) -> Self: ... def outerjoin(self, target, onclause: Incomplete | None = ..., full: bool = ...): ... def get_final_froms(self): ... @@ -359,18 +360,18 @@ class Select( def inner_columns(self): ... def is_derived_from(self, fromclause): ... def get_children(self, **kwargs): ... - def add_columns(self: Self, *columns) -> Self: ... + def add_columns(self, *columns) -> Self: ... def column(self, column): ... def reduce_columns(self, only_synonyms: bool = ...): ... - def with_only_columns(self: Self, *columns, **kw) -> Self: ... + def with_only_columns(self, *columns, **kw) -> Self: ... @property def whereclause(self): ... - def where(self: Self, *whereclause) -> Self: ... - def having(self: Self, having) -> Self: ... - def distinct(self: Self, *expr) -> Self: ... - def select_from(self: Self, *froms) -> Self: ... - def correlate(self: Self, *fromclauses) -> Self: ... - def correlate_except(self: Self, *fromclauses) -> Self: ... + def where(self, *whereclause) -> Self: ... + def having(self, having) -> Self: ... + def distinct(self, *expr) -> Self: ... + def select_from(self, *froms) -> Self: ... + def correlate(self, *fromclauses) -> Self: ... + def correlate_except(self, *fromclauses) -> Self: ... @HasMemoized.memoized_attribute def selected_columns(self): ... def self_group(self, against: Incomplete | None = ...): ... @@ -394,10 +395,10 @@ class ScalarSelect(roles.InElementRole, Generative, Grouping): def columns(self) -> None: ... @property def c(self): ... - def where(self: Self, crit) -> Self: ... + def where(self, crit) -> Self: ... def self_group(self, **kwargs): ... - def correlate(self: Self, *fromclauses) -> Self: ... - def correlate_except(self: Self, *fromclauses) -> Self: ... + def correlate(self, *fromclauses) -> Self: ... + def correlate_except(self, *fromclauses) -> Self: ... class Exists(UnaryExpression): inherit_cache: bool @@ -418,7 +419,7 @@ class TextualSelect(SelectBase): def __init__(self, text, columns, positional: bool = ...) -> None: ... @HasMemoized.memoized_attribute def selected_columns(self): ... - def bindparams(self: Self, *binds, **bind_as_values) -> Self: ... + def bindparams(self, *binds, **bind_as_values) -> Self: ... TextAsFrom = TextualSelect diff --git a/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi b/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi index c345cfd901fb..52dea187a5cd 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi @@ -1,5 +1,6 @@ +from typing_extensions import Self import collections.abc -from _typeshed import Incomplete, Self, SupportsKeysAndGetItem +from _typeshed import Incomplete, SupportsKeysAndGetItem from collections.abc import Callable, Iterable, Iterator, Mapping from typing import Any, Generic, NoReturn, TypeVar, overload @@ -82,21 +83,21 @@ class OrderedSet(set[_T], Generic[_T]): def __getitem__(self, key: int) -> _T: ... def __iter__(self) -> Iterator[_T]: ... def __add__(self, other: Iterable[_S]) -> OrderedSet[_S | _T]: ... - def update(self: Self, iterable: Iterable[_T]) -> Self: ... # type: ignore[override] + def update(self, iterable: Iterable[_T]) -> Self: ... # type: ignore[override] __ior__ = update # type: ignore[assignment] def union(self, other: Iterable[_S]) -> OrderedSet[_S | _T]: ... # type: ignore[override] __or__ = union # type: ignore[assignment] # pyright: ignore[reportGeneralTypeIssues] - def intersection(self: Self, other: Iterable[Any]) -> Self: ... # type: ignore[override] + def intersection(self, other: Iterable[Any]) -> Self: ... # type: ignore[override] __and__ = intersection # type: ignore[assignment] # pyright: ignore[reportGeneralTypeIssues] def symmetric_difference(self, other: Iterable[_S]) -> OrderedSet[_S | _T]: ... __xor__ = symmetric_difference # type: ignore[assignment] # pyright: ignore[reportGeneralTypeIssues] - def difference(self: Self, other: Iterable[Any]) -> Self: ... # type: ignore[override] + def difference(self, other: Iterable[Any]) -> Self: ... # type: ignore[override] __sub__ = difference # type: ignore[assignment] # pyright: ignore[reportGeneralTypeIssues] - def intersection_update(self: Self, other: Iterable[Any]) -> Self: ... # type: ignore[override] + def intersection_update(self, other: Iterable[Any]) -> Self: ... # type: ignore[override] __iand__ = intersection_update # type: ignore[assignment] - def symmetric_difference_update(self: Self, other: Iterable[_T]) -> Self: ... # type: ignore[override] + def symmetric_difference_update(self, other: Iterable[_T]) -> Self: ... # type: ignore[override] __ixor__ = symmetric_difference_update # type: ignore[assignment] - def difference_update(self: Self, other: Iterable[Any]) -> Self: ... # type: ignore[override] + def difference_update(self, other: Iterable[Any]) -> Self: ... # type: ignore[override] __isub__ = difference_update # type: ignore[assignment] class IdentitySet: diff --git a/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi b/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi index 4c3949000381..44535e7fcba1 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from collections.abc import Callable from typing import Any, Generic, TypeVar, overload @@ -70,7 +71,7 @@ class memoized_property(Generic[_R]): __name__: str def __init__(self, fget: Callable[..., _R], doc: str | None = ...) -> None: ... @overload - def __get__(self: Self, obj: None, cls: object) -> Self: ... + def __get__(self, obj: None, cls: object) -> Self: ... @overload def __get__(self, obj: object, cls: object) -> _R: ... @classmethod @@ -85,7 +86,7 @@ class HasMemoized: __name__: str def __init__(self, fget: Callable[..., _R], doc: str | None = ...) -> None: ... @overload - def __get__(self: Self, obj: None, cls: object) -> Self: ... + def __get__(self, obj: None, cls: object) -> Self: ... @overload def __get__(self, obj: object, cls: object) -> _R: ... @@ -119,7 +120,7 @@ class hybridproperty(Generic[_R]): def __get__(self, instance: None, owner: Any) -> _R: ... @overload def __get__(self, instance: object, owner: object) -> _R: ... - def classlevel(self: Self, func: Callable[..., _R]) -> Self: ... + def classlevel(self, func: Callable[..., _R]) -> Self: ... class hybridmethod: func: Any diff --git a/stubs/aiofiles/aiofiles/base.pyi b/stubs/aiofiles/aiofiles/base.pyi index 8919031e216c..4d1b2890d58a 100644 --- a/stubs/aiofiles/aiofiles/base.pyi +++ b/stubs/aiofiles/aiofiles/base.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from collections.abc import Coroutine, Generator, Iterator from types import CodeType, FrameType, TracebackType, coroutine from typing import Any, Generic, TypeVar @@ -10,7 +10,7 @@ _T_contra = TypeVar("_T_contra", contravariant=True) class AsyncBase(Generic[_T]): def __init__(self, file: str, loop: Any, executor: Any) -> None: ... - def __aiter__(self: Self) -> Self: ... + def __aiter__(self) -> Self: ... async def __anext__(self) -> _T: ... class AiofilesContextManager(Generic[_T_co, _T_contra, _V_co]): diff --git a/stubs/aws-xray-sdk/aws_xray_sdk/core/models/trace_header.pyi b/stubs/aws-xray-sdk/aws_xray_sdk/core/models/trace_header.pyi index ba1d9b06a909..c48e0a4cfe23 100644 --- a/stubs/aws-xray-sdk/aws_xray_sdk/core/models/trace_header.pyi +++ b/stubs/aws-xray-sdk/aws_xray_sdk/core/models/trace_header.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from typing import Any log: Any @@ -13,7 +13,7 @@ class TraceHeader: self, root: str | None = ..., parent: str | None = ..., sampled: bool | None = ..., data: dict[str, Any] | None = ... ) -> None: ... @classmethod - def from_header_str(cls: type[Self], header) -> Self: ... + def from_header_str(cls, header) -> Self: ... def to_header_str(self): ... @property def root(self): ... diff --git a/stubs/beautifulsoup4/bs4/__init__.pyi b/stubs/beautifulsoup4/bs4/__init__.pyi index f22af5493bec..d77c59b046f7 100644 --- a/stubs/beautifulsoup4/bs4/__init__.pyi +++ b/stubs/beautifulsoup4/bs4/__init__.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self, SupportsRead +from typing_extensions import Self +from _typeshed import Incomplete, SupportsRead from collections.abc import Sequence from typing import Any @@ -45,7 +46,7 @@ class BeautifulSoup(Tag): element_classes: dict[type[PageElement], type[Any]] | None = ..., **kwargs, ) -> None: ... - def __copy__(self: Self) -> Self: ... + def __copy__(self) -> Self: ... hidden: bool current_data: Any currentTag: Any diff --git a/stubs/beautifulsoup4/bs4/element.pyi b/stubs/beautifulsoup4/bs4/element.pyi index 5aef46e4e10c..0f41d1877fd8 100644 --- a/stubs/beautifulsoup4/bs4/element.pyi +++ b/stubs/beautifulsoup4/bs4/element.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from collections.abc import Callable, Iterable, Iterator from re import Pattern from typing import Any, Generic, TypeVar, overload @@ -14,7 +15,7 @@ whitespace_re: Pattern[str] PYTHON_SPECIFIC_ENCODINGS: set[str] class NamespacedAttribute(str): - def __new__(cls: type[Self], prefix: str, name: str | None = ..., namespace: str | None = ...) -> Self: ... + def __new__(cls, prefix: str, name: str | None = ..., namespace: str | None = ...) -> Self: ... class AttributeValueWithCharsetSubstitution(str): ... @@ -57,13 +58,13 @@ class PageElement: getText = get_text @property def text(self) -> str: ... - def replace_with(self: Self, *args: PageElement | str) -> Self: ... + def replace_with(self, *args: PageElement | str) -> Self: ... replaceWith = replace_with - def unwrap(self: Self) -> Self: ... + def unwrap(self) -> Self: ... replace_with_children = unwrap replaceWithChildren = unwrap def wrap(self, wrap_inside: _PageElementT) -> _PageElementT: ... - def extract(self: Self, _self_index: int | None = ...) -> Self: ... + def extract(self, _self_index: int | None = ...) -> Self: ... def insert(self, position: int, new_child: PageElement | str) -> None: ... def append(self, tag: PageElement | str) -> None: ... def extend(self, tags: Iterable[PageElement | str]) -> None: ... @@ -182,8 +183,8 @@ class NavigableString(str, PageElement): PREFIX: str SUFFIX: str known_xml: bool | None - def __new__(cls: type[Self], value: str | bytes) -> Self: ... - def __copy__(self: Self) -> Self: ... + def __new__(cls, value: str | bytes) -> Self: ... + def __copy__(self) -> Self: ... def __getnewargs__(self) -> tuple[str]: ... def output_ready(self, formatter: Formatter | str | None = ...) -> str: ... @property @@ -260,7 +261,7 @@ class Tag(PageElement): namespaces: dict[str, str] | None = ..., ) -> None: ... parserClass: type[BeautifulSoup] | None - def __copy__(self: Self) -> Self: ... + def __copy__(self) -> Self: ... @property def is_empty_element(self) -> bool: ... @property diff --git a/stubs/caldav/caldav/davclient.pyi b/stubs/caldav/caldav/davclient.pyi index ab99a10c51ac..72cf7612be3b 100644 --- a/stubs/caldav/caldav/davclient.pyi +++ b/stubs/caldav/caldav/davclient.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from collections.abc import Iterable, Mapping from typing import Any from typing_extensions import TypeAlias @@ -50,7 +50,7 @@ class DAVClient: ssl_verify_cert: bool | str = ..., ssl_cert: str | tuple[str, str] | None = ..., ) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, exc_type: object, exc_value: object, traceback: object) -> None: ... def principal(self, *, url: str | ParseResult | SplitResult | URL | None = ...) -> Principal: ... def calendar( diff --git a/stubs/caldav/caldav/elements/base.pyi b/stubs/caldav/caldav/elements/base.pyi index 84e229ea66b3..5417d2f95286 100644 --- a/stubs/caldav/caldav/elements/base.pyi +++ b/stubs/caldav/caldav/elements/base.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from collections.abc import Iterable from typing import Any, ClassVar from typing_extensions import TypeAlias @@ -12,10 +13,10 @@ class BaseElement: attributes: Incomplete | None caldav_class: Incomplete | None def __init__(self, name: str | None = ..., value: str | bytes | None = ...) -> None: ... - def __add__(self: Self, other: BaseElement) -> Self: ... + def __add__(self, other: BaseElement) -> Self: ... def xmlelement(self) -> _Element: ... def xmlchildren(self, root: _Element) -> None: ... - def append(self: Self, element: BaseElement | Iterable[BaseElement]) -> Self: ... + def append(self, element: BaseElement | Iterable[BaseElement]) -> Self: ... class NamedBaseElement(BaseElement): def __init__(self, name: str | None = ...) -> None: ... diff --git a/stubs/caldav/caldav/objects.pyi b/stubs/caldav/caldav/objects.pyi index ba748e7cf0f2..d2769297a03f 100644 --- a/stubs/caldav/caldav/objects.pyi +++ b/stubs/caldav/caldav/objects.pyi @@ -1,5 +1,6 @@ +from typing_extensions import Self import datetime -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from collections.abc import Iterable, Iterator, Mapping, Sequence from typing import Any, TypeVar, overload from typing_extensions import Literal, TypeAlias @@ -41,8 +42,8 @@ class DAVObject: def get_properties( self, props: Incomplete | None = ..., depth: int = ..., parse_response_xml: bool = ..., parse_props: bool = ... ): ... - def set_properties(self: Self, props: Incomplete | None = ...) -> Self: ... - def save(self: Self) -> Self: ... + def set_properties(self, props: Incomplete | None = ...) -> Self: ... + def save(self) -> Self: ... def delete(self) -> None: ... class CalendarSet(DAVObject): @@ -208,18 +209,18 @@ class CalendarObjectResource(DAVObject): props: Incomplete | None = ..., ) -> None: ... def add_organizer(self) -> None: ... - def split_expanded(self: Self) -> list[Self]: ... + def split_expanded(self) -> list[Self]: ... def expand_rrule(self, start: datetime.datetime, end: datetime.datetime) -> None: ... def add_attendee(self, attendee, no_default_parameters: bool = ..., **parameters) -> None: ... def is_invite_request(self) -> bool: ... def accept_invite(self, calendar: Incomplete | None = ...) -> None: ... def decline_invite(self, calendar: Incomplete | None = ...) -> None: ... def tentatively_accept_invite(self, calendar: Incomplete | None = ...) -> None: ... - def copy(self: Self, keep_uid: bool = ..., new_parent: Incomplete | None = ...) -> Self: ... - def load(self: Self) -> Self: ... + def copy(self, keep_uid: bool = ..., new_parent: Incomplete | None = ...) -> Self: ... + def load(self) -> Self: ... def change_attendee_status(self, attendee: Incomplete | None = ..., **kwargs) -> None: ... def save( - self: Self, + self, no_overwrite: bool = ..., no_create: bool = ..., obj_type: str | None = ..., diff --git a/stubs/click-spinner/click_spinner/__init__.pyi b/stubs/click-spinner/click_spinner/__init__.pyi index 68a1ba1521bf..753f88a5a557 100644 --- a/stubs/click-spinner/click_spinner/__init__.pyi +++ b/stubs/click-spinner/click_spinner/__init__.pyi @@ -1,5 +1,5 @@ +from typing_extensions import Self import threading -from _typeshed import Self from collections.abc import Iterator from types import TracebackType from typing import Protocol @@ -24,7 +24,7 @@ class Spinner: def start(self) -> None: ... def stop(self) -> None: ... def init_spin(self) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> Literal[False]: ... diff --git a/stubs/croniter/croniter/croniter.pyi b/stubs/croniter/croniter/croniter.pyi index 45b8d5c32869..7ed4efb42f37 100644 --- a/stubs/croniter/croniter/croniter.pyi +++ b/stubs/croniter/croniter/croniter.pyi @@ -1,5 +1,6 @@ +from typing_extensions import Self import datetime -from _typeshed import ReadableBuffer, Self +from _typeshed import ReadableBuffer from collections import OrderedDict from collections.abc import Iterator from re import Match, Pattern @@ -69,7 +70,7 @@ class croniter(Iterator[Any]): def get_prev(self, ret_type: _RetType | None = ...) -> Any: ... def get_current(self, ret_type: _RetType | None = ...) -> Any: ... def set_current(self, start_time: float | datetime.datetime | None, force: bool = ...) -> float: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def next( self, ret_type: _RetType | None = ..., start_time: float | datetime.datetime | None = ..., is_prev: bool | None = ... ) -> Any: ... diff --git a/stubs/dateparser/dateparser/conf.pyi b/stubs/dateparser/dateparser/conf.pyi index 4d2153dd5042..ef9ed00a6fac 100644 --- a/stubs/dateparser/dateparser/conf.pyi +++ b/stubs/dateparser/dateparser/conf.pyi @@ -1,8 +1,9 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from typing import Any class Settings: - def __new__(cls: type[Self], *args, **kw) -> Self: ... + def __new__(cls, *args, **kw) -> Self: ... def __init__(self, settings: Incomplete | None = ...) -> None: ... @classmethod def get_key(cls, settings: Incomplete | None = ...): ... diff --git a/stubs/docutils/docutils/__init__.pyi b/stubs/docutils/docutils/__init__.pyi index cfa9914a6a4e..d6b5f3448855 100644 --- a/stubs/docutils/docutils/__init__.pyi +++ b/stubs/docutils/docutils/__init__.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from typing import Any, ClassVar, NamedTuple __docformat__: str @@ -14,7 +14,7 @@ class _VersionInfo(NamedTuple): class VersionInfo(_VersionInfo): def __new__( - cls: type[Self], + cls, major: int = ..., minor: int = ..., micro: int = ..., diff --git a/stubs/docutils/docutils/nodes.pyi b/stubs/docutils/docutils/nodes.pyi index 5281bdca1705..25c039367bb2 100644 --- a/stubs/docutils/docutils/nodes.pyi +++ b/stubs/docutils/docutils/nodes.pyi @@ -1,5 +1,6 @@ +from typing_extensions import Self import xml.dom.minidom -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from abc import abstractmethod from collections.abc import Callable, Generator, Iterable, Sequence from typing import Any, ClassVar, Protocol, TypeVar, overload @@ -26,9 +27,9 @@ class Node: # (although it's not used in the docutils implementation) because it # makes Mypy reject Node() with "Cannot instantiate abstract class". @abstractmethod - def copy(self: Self) -> Self: ... + def copy(self) -> Self: ... @abstractmethod - def deepcopy(self: Self) -> Self: ... + def deepcopy(self) -> Self: ... @abstractmethod def pformat(self, indent: str = ..., level: int = ...) -> str: ... @abstractmethod @@ -97,9 +98,9 @@ class Element(Node): def __delitem__(self, key: str | int | slice) -> None: ... def __add__(self, other: list[Node]) -> list[Node]: ... def __radd__(self, other: list[Node]) -> list[Node]: ... - def __iadd__(self: Self, other: Node | Iterable[Node]) -> Self: ... - def copy(self: Self) -> Self: ... - def deepcopy(self: Self) -> Self: ... + def __iadd__(self, other: Node | Iterable[Node]) -> Self: ... + def copy(self) -> Self: ... + def deepcopy(self) -> Self: ... def pformat(self, indent: str = ..., level: int = ...) -> str: ... def astext(self) -> str: ... def __getattr__(self, __name: str) -> Incomplete: ... @@ -109,11 +110,11 @@ class Text(Node, str): children: tuple[()] # we omit the rawsource parameter because it has been deprecated and is ignored - def __new__(cls: type[Self], data: str) -> Self: ... + def __new__(cls, data: str) -> Self: ... def __init__(self, data: str) -> None: ... def shortrepr(self, maxlen: int = ...) -> str: ... - def copy(self: Self) -> Self: ... - def deepcopy(self: Self) -> Self: ... + def copy(self) -> Self: ... + def deepcopy(self) -> Self: ... def pformat(self, indent: str = ..., level: int = ...) -> str: ... def astext(self) -> str: ... def rstrip(self, chars: str | None = ...) -> str: ... @@ -124,8 +125,8 @@ class Root: ... class document(Root, Structural, Element): transformer: Transformer - def copy(self: Self) -> Self: ... - def deepcopy(self: Self) -> Self: ... + def copy(self) -> Self: ... + def deepcopy(self) -> Self: ... def pformat(self, indent: str = ..., level: int = ...) -> str: ... def astext(self) -> str: ... def __getattr__(self, __name: str) -> Incomplete: ... diff --git a/stubs/entrypoints/entrypoints.pyi b/stubs/entrypoints/entrypoints.pyi index ce9eb7869e94..a76fc9195de5 100644 --- a/stubs/entrypoints/entrypoints.pyi +++ b/stubs/entrypoints/entrypoints.pyi @@ -1,5 +1,5 @@ +from typing_extensions import Self import sys -from _typeshed import Self from collections.abc import Iterator, Sequence from configparser import ConfigParser from typing import Any @@ -36,14 +36,14 @@ class EntryPoint: ) -> None: ... def load(self) -> Any: ... @classmethod - def from_string(cls: type[Self], epstr: str, name: str, distro: Distribution | None = ...) -> Self: ... + def from_string(cls, epstr: str, name: str, distro: Distribution | None = ...) -> Self: ... class Distribution: name: str version: str def __init__(self, name: str, version: str) -> None: ... @classmethod - def from_name_version(cls: type[Self], name: str) -> Self: ... + def from_name_version(cls, name: str) -> Self: ... def iter_files_distros( path: Sequence[str] | None = ..., repeated_distro: str = ... diff --git a/stubs/fpdf2/fpdf/drawing.pyi b/stubs/fpdf2/fpdf/drawing.pyi index 7a78abebf57a..da91a00dfaa6 100644 --- a/stubs/fpdf2/fpdf/drawing.pyi +++ b/stubs/fpdf2/fpdf/drawing.pyi @@ -1,5 +1,6 @@ +from typing_extensions import Self import decimal -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from collections import OrderedDict from collections.abc import Callable, Generator, Iterator from contextlib import contextmanager @@ -38,7 +39,7 @@ class _DeviceRGBBase(NamedTuple): class DeviceRGB(_DeviceRGBBase): OPERATOR: ClassVar[str] - def __new__(cls: type[Self], r: Number, g: Number, b: Number, a: Number | None = ...) -> Self: ... + def __new__(cls, r: Number, g: Number, b: Number, a: Number | None = ...) -> Self: ... @property def colors(self) -> tuple[Number, Number, Number]: ... def serialize(self) -> str: ... @@ -49,7 +50,7 @@ class _DeviceGrayBase(NamedTuple): class DeviceGray(_DeviceGrayBase): OPERATOR: ClassVar[str] - def __new__(cls: type[Self], g: Number, a: Number | None = ...) -> Self: ... + def __new__(cls, g: Number, a: Number | None = ...) -> Self: ... @property def colors(self) -> tuple[Number]: ... def serialize(self) -> str: ... @@ -63,7 +64,7 @@ class _DeviceCMYKBase(NamedTuple): class DeviceCMYK(_DeviceCMYKBase): OPERATOR: ClassVar[str] - def __new__(cls: type[Self], c: Number, m: Number, y: Number, k: Number, a: Number | None = ...) -> Self: ... + def __new__(cls, c: Number, m: Number, y: Number, k: Number, a: Number | None = ...) -> Self: ... @property def colors(self) -> tuple[Number, Number, Number, Number]: ... def serialize(self) -> str: ... @@ -128,7 +129,7 @@ class GraphicsStyle: @classmethod def merge(cls, parent, child): ... def __init__(self) -> None: ... - def __deepcopy__(self: Self, memo) -> Self: ... + def __deepcopy__(self, memo) -> Self: ... @property def allow_transparency(self): ... @allow_transparency.setter @@ -322,7 +323,7 @@ class DrawingContext: class PaintedPath: def __init__(self, x: int = ..., y: int = ...) -> None: ... - def __deepcopy__(self: Self, memo) -> Self: ... + def __deepcopy__(self, memo) -> Self: ... @property def style(self): ... @property @@ -342,26 +343,26 @@ class PaintedPath: @clipping_path.setter def clipping_path(self, new_clipath) -> None: ... @contextmanager - def transform_group(self: Self, transform) -> Iterator[Self]: ... + def transform_group(self, transform) -> Iterator[Self]: ... def add_path_element(self, item, _copy: bool = ...) -> None: ... def remove_last_path_element(self) -> None: ... - def rectangle(self: Self, x, y, w, h, rx: int = ..., ry: int = ...) -> Self: ... - def circle(self: Self, cx, cy, r) -> Self: ... - def ellipse(self: Self, cx, cy, rx, ry) -> Self: ... - def move_to(self: Self, x, y) -> Self: ... - def move_relative(self: Self, x, y) -> Self: ... - def line_to(self: Self, x, y) -> Self: ... - def line_relative(self: Self, dx, dy) -> Self: ... - def horizontal_line_to(self: Self, x) -> Self: ... - def horizontal_line_relative(self: Self, dx) -> Self: ... - def vertical_line_to(self: Self, y) -> Self: ... - def vertical_line_relative(self: Self, dy) -> Self: ... - def curve_to(self: Self, x1, y1, x2, y2, x3, y3) -> Self: ... - def curve_relative(self: Self, dx1, dy1, dx2, dy2, dx3, dy3) -> Self: ... - def quadratic_curve_to(self: Self, x1, y1, x2, y2) -> Self: ... - def quadratic_curve_relative(self: Self, dx1, dy1, dx2, dy2) -> Self: ... - def arc_to(self: Self, rx, ry, rotation, large_arc, positive_sweep, x, y) -> Self: ... - def arc_relative(self: Self, rx, ry, rotation, large_arc, positive_sweep, dx, dy) -> Self: ... + def rectangle(self, x, y, w, h, rx: int = ..., ry: int = ...) -> Self: ... + def circle(self, cx, cy, r) -> Self: ... + def ellipse(self, cx, cy, rx, ry) -> Self: ... + def move_to(self, x, y) -> Self: ... + def move_relative(self, x, y) -> Self: ... + def line_to(self, x, y) -> Self: ... + def line_relative(self, dx, dy) -> Self: ... + def horizontal_line_to(self, x) -> Self: ... + def horizontal_line_relative(self, dx) -> Self: ... + def vertical_line_to(self, y) -> Self: ... + def vertical_line_relative(self, dy) -> Self: ... + def curve_to(self, x1, y1, x2, y2, x3, y3) -> Self: ... + def curve_relative(self, dx1, dy1, dx2, dy2, dx3, dy3) -> Self: ... + def quadratic_curve_to(self, x1, y1, x2, y2) -> Self: ... + def quadratic_curve_relative(self, dx1, dy1, dx2, dy2) -> Self: ... + def arc_to(self, rx, ry, rotation, large_arc, positive_sweep, x, y) -> Self: ... + def arc_relative(self, rx, ry, rotation, large_arc, positive_sweep, dx, dy) -> Self: ... def close(self) -> None: ... def render( self, gsd_registry, style, last_item, initial_point, debug_stream: Incomplete | None = ..., pfx: Incomplete | None = ... @@ -380,7 +381,7 @@ class GraphicsContext: style: GraphicsStyle path_items: list[Incomplete] def __init__(self) -> None: ... - def __deepcopy__(self: Self, memo) -> Self: ... + def __deepcopy__(self, memo) -> Self: ... @property def transform(self) -> Transform | None: ... @transform.setter diff --git a/stubs/fpdf2/fpdf/enums.pyi b/stubs/fpdf2/fpdf/enums.pyi index 395e28103fd4..68dd2692c7a7 100644 --- a/stubs/fpdf2/fpdf/enums.pyi +++ b/stubs/fpdf2/fpdf/enums.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from enum import Enum, Flag, IntEnum, IntFlag from typing_extensions import Literal @@ -10,11 +10,11 @@ class SignatureFlag(IntEnum): class CoerciveEnum(Enum): @classmethod - def coerce(cls: type[Self], value: Self | str) -> Self: ... + def coerce(cls, value: Self | str) -> Self: ... class CoerciveIntEnum(IntEnum): @classmethod - def coerce(cls: type[Self], value: Self | str | int) -> Self: ... + def coerce(cls, value: Self | str | int) -> Self: ... class CharVPos(CoerciveEnum): SUP: str 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 58ab248b8b54..a24f5937ef01 100644 --- a/stubs/google-cloud-ndb/google/cloud/ndb/global_cache.pyi +++ b/stubs/google-cloud-ndb/google/cloud/ndb/global_cache.pyi @@ -1,5 +1,6 @@ +from typing_extensions import Self import abc -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from typing import Any ConnectionError: Any @@ -38,7 +39,7 @@ class _InProcessGlobalCache(GlobalCache): class RedisCache(GlobalCache): transient_errors: Any @classmethod - def from_environment(cls: type[Self], strict_read: bool = ..., strict_write: bool = ...) -> Self: ... + def from_environment(cls, strict_read: bool = ..., strict_write: bool = ...) -> Self: ... redis: Any strict_read: Any strict_write: Any @@ -61,7 +62,7 @@ class MemcacheCache(GlobalCache): transient_errors: Any @classmethod def from_environment( - cls: type[Self], max_pool_size: int = ..., strict_read: bool = ..., strict_write: bool = ... + cls, max_pool_size: int = ..., strict_read: bool = ..., strict_write: bool = ... ) -> Self: ... client: Any strict_read: Any diff --git a/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi b/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi index 8cd1415a21e0..e990d478c251 100644 --- a/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi +++ b/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi @@ -1,5 +1,5 @@ +from typing_extensions import Self import datetime -from _typeshed import Self from collections.abc import Callable, Iterable, Sequence from typing import Any, NoReturn from typing_extensions import Literal, TypeAlias @@ -27,7 +27,7 @@ class _NotEqualMixin: _Direction: TypeAlias = Literal["asc", "desc"] class IndexProperty(_NotEqualMixin): - def __new__(cls: type[Self], name: str, direction: _Direction) -> Self: ... + def __new__(cls, name: str, direction: _Direction) -> Self: ... @property def name(self) -> str: ... @property @@ -36,7 +36,7 @@ class IndexProperty(_NotEqualMixin): def __hash__(self) -> int: ... class Index(_NotEqualMixin): - def __new__(cls: type[Self], kind: str, properties: list[IndexProperty], ancestor: bool) -> Self: ... + def __new__(cls, kind: str, properties: list[IndexProperty], ancestor: bool) -> Self: ... @property def kind(self) -> str: ... @property @@ -59,7 +59,7 @@ class IndexState(_NotEqualMixin): class ModelAdapter: # This actually returns NoReturn, but mypy can't handle that - def __new__(cls: type[Self], *args, **kwargs) -> Self: ... + def __new__(cls, *args, **kwargs) -> Self: ... def make_connection(*args, **kwargs) -> NoReturn: ... diff --git a/stubs/httplib2/httplib2/__init__.pyi b/stubs/httplib2/httplib2/__init__.pyi index 44240e42283e..427c1727a4fb 100644 --- a/stubs/httplib2/httplib2/__init__.pyi +++ b/stubs/httplib2/httplib2/__init__.pyi @@ -1,5 +1,6 @@ +from typing_extensions import Self import http.client -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from collections.abc import Generator from typing import Any, ClassVar @@ -184,4 +185,4 @@ class Response(dict[str, Any]): previous: Any def __init__(self, info) -> None: ... @property - def dict(self: Self) -> Self: ... + def dict(self) -> Self: ... diff --git a/stubs/ibm-db/ibm_db.pyi b/stubs/ibm-db/ibm_db.pyi index af58121341d6..ff2d4b9a9bdd 100644 --- a/stubs/ibm-db/ibm_db.pyi +++ b/stubs/ibm-db/ibm_db.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from typing import Any, overload from typing_extensions import final @@ -85,7 +85,7 @@ WCHAR_YES: int @final class IBM_DBClientInfo: - def __new__(cls: type[Self], *args: object, **kwargs: object) -> Self: ... + def __new__(cls, *args: object, **kwargs: object) -> Self: ... APPL_CODEPAGE: int CONN_CODEPAGE: int DATA_SOURCE_NAME: str @@ -97,11 +97,11 @@ class IBM_DBClientInfo: @final class IBM_DBConnection: - def __new__(cls: type[Self], *args: object, **kwargs: object) -> Self: ... + def __new__(cls, *args: object, **kwargs: object) -> Self: ... @final class IBM_DBServerInfo: - def __new__(cls: type[Self], *args: object, **kwargs: object) -> Self: ... + def __new__(cls, *args: object, **kwargs: object) -> Self: ... DBMS_NAME: str DBMS_VER: str DB_CODEPAGE: int @@ -127,7 +127,7 @@ class IBM_DBServerInfo: @final class IBM_DBStatement: - def __new__(cls: type[Self], *args: object, **kwargs: object) -> Self: ... + def __new__(cls, *args: object, **kwargs: object) -> Self: ... def active(__connection: IBM_DBConnection | None) -> bool: ... def autocommit(__connection: IBM_DBConnection, __value: int = ...) -> int | bool: ... diff --git a/stubs/influxdb-client/influxdb_client/client/flux_csv_parser.pyi b/stubs/influxdb-client/influxdb_client/client/flux_csv_parser.pyi index 932ffa0d9678..778f2a340425 100644 --- a/stubs/influxdb-client/influxdb_client/client/flux_csv_parser.pyi +++ b/stubs/influxdb-client/influxdb_client/client/flux_csv_parser.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from collections.abc import Generator from enum import Enum @@ -44,9 +45,9 @@ class FluxCsvParser: query_options: Incomplete | None = ..., response_metadata_mode: FluxResponseMetadataMode = ..., ) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, exc_type, exc_val, exc_tb) -> None: ... - async def __aenter__(self: Self) -> Self: ... + async def __aenter__(self) -> Self: ... async def __aexit__(self, exc_type, exc_val, exc_tb) -> None: ... def generator(self) -> Generator[Incomplete, None, None]: ... def generator_async(self): ... diff --git a/stubs/influxdb-client/influxdb_client/client/influxdb_client.pyi b/stubs/influxdb-client/influxdb_client/client/influxdb_client.pyi index 6cc070cd5221..58e3de3589c8 100644 --- a/stubs/influxdb-client/influxdb_client/client/influxdb_client.pyi +++ b/stubs/influxdb-client/influxdb_client/client/influxdb_client.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from influxdb_client import HealthCheck, InvokableScriptsApi, Ready from influxdb_client.client._base import _BaseClient @@ -41,7 +42,7 @@ class InfluxDBClient(_BaseClient): retries: bool | Incomplete = ..., profilers: Incomplete | None = ..., ) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, exc_type: object, exc_value: object, traceback: object) -> None: ... @classmethod def from_config_file(cls, config_file: str = ..., debug: Incomplete | None = ..., enable_gzip: bool = ..., **kwargs): ... diff --git a/stubs/influxdb-client/influxdb_client/client/influxdb_client_async.pyi b/stubs/influxdb-client/influxdb_client/client/influxdb_client_async.pyi index 14605d16d290..a810beaae5db 100644 --- a/stubs/influxdb-client/influxdb_client/client/influxdb_client_async.pyi +++ b/stubs/influxdb-client/influxdb_client/client/influxdb_client_async.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from influxdb_client.client._base import _BaseClient from influxdb_client.client.delete_api_async import DeleteApiAsync @@ -35,7 +36,7 @@ class InfluxDBClientAsync(_BaseClient): retries: bool | Incomplete = ..., profilers: Incomplete | None = ..., ) -> None: ... - async def __aenter__(self: Self) -> Self: ... + async def __aenter__(self) -> Self: ... async def __aexit__(self, exc_type: object, exc: object, tb: object) -> None: ... async def close(self) -> None: ... @classmethod diff --git a/stubs/influxdb-client/influxdb_client/client/write/point.pyi b/stubs/influxdb-client/influxdb_client/client/write/point.pyi index a3aadf750e37..b44873195f24 100644 --- a/stubs/influxdb-client/influxdb_client/client/write/point.pyi +++ b/stubs/influxdb-client/influxdb_client/client/write/point.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self, SupportsGetItem, SupportsItems +from typing_extensions import Self +from _typeshed import Incomplete, SupportsGetItem, SupportsItems from collections.abc import Iterable from datetime import datetime, timedelta from numbers import Integral @@ -29,9 +30,9 @@ class Point: fields: SupportsItems[str, Literal["int", "uint", "float"]] = ..., ) -> Point: ... def __init__(self, measurement_name: str) -> None: ... - def time(self: Self, time: _Time, write_precision: _WritePrecision = ...) -> Self: ... - def tag(self: Self, key: str, value: _Value) -> Self: ... - def field(self: Self, field: str, value: _Value) -> Self: ... + def time(self, time: _Time, write_precision: _WritePrecision = ...) -> Self: ... + def tag(self, key: str, value: _Value) -> Self: ... + def field(self, field: str, value: _Value) -> Self: ... def to_line_protocol(self, precision: _WritePrecision | None = ...) -> str: ... @property def write_precision(self) -> _WritePrecision: ... diff --git a/stubs/invoke/invoke/tasks.pyi b/stubs/invoke/invoke/tasks.pyi index 3da35f6c9d69..08f0822d7b46 100644 --- a/stubs/invoke/invoke/tasks.pyi +++ b/stubs/invoke/invoke/tasks.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from collections.abc import Callable, Iterable from typing import Any, Generic, TypeVar, overload from typing_extensions import ParamSpec @@ -105,7 +106,7 @@ class Call: kwargs: dict[str, Any] | None = ..., ) -> None: ... def __getattr__(self, name: str) -> Any: ... - def __deepcopy__(self: Self, memo: Any) -> Self: ... + def __deepcopy__(self, memo: Any) -> Self: ... def __eq__(self, other: Call) -> bool: ... # type: ignore[override] def make_context(self, config: Config) -> Context: ... def clone_data(self): ... diff --git a/stubs/jsonschema/jsonschema/exceptions.pyi b/stubs/jsonschema/jsonschema/exceptions.pyi index 2698976bcd21..4971067fdbe0 100644 --- a/stubs/jsonschema/jsonschema/exceptions.pyi +++ b/stubs/jsonschema/jsonschema/exceptions.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self, SupportsRichComparison +from typing_extensions import Self +from _typeshed import Incomplete, SupportsRichComparison from collections import deque from collections.abc import Callable, Container, Iterable, Sequence from typing import Any @@ -40,7 +41,7 @@ class _Error(Exception): type_checker: _utils.Unset | TypeChecker = ..., ) -> None: ... @classmethod - def create_from(cls: type[Self], other: _Error) -> Self: ... + def create_from(cls, other: _Error) -> Self: ... @property def absolute_path(self) -> Sequence[str | int]: ... @property diff --git a/stubs/ldap3/ldap3/core/connection.pyi b/stubs/ldap3/ldap3/core/connection.pyi index fe7acb4673d2..23f0b226a7d6 100644 --- a/stubs/ldap3/ldap3/core/connection.pyi +++ b/stubs/ldap3/ldap3/core/connection.pyi @@ -1,5 +1,6 @@ +from typing_extensions import Self from _collections_abc import Generator, dict_keys -from _typeshed import Incomplete, ReadableBuffer, Self +from _typeshed import Incomplete, ReadableBuffer, from types import TracebackType from typing_extensions import Literal, TypeAlias @@ -115,7 +116,7 @@ class Connection: def stream(self, value) -> None: ... @property def usage(self): ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> Literal[False] | None: ... diff --git a/stubs/ldap3/ldap3/core/exceptions.pyi b/stubs/ldap3/ldap3/core/exceptions.pyi index 862291cd3299..c36d7089431c 100644 --- a/stubs/ldap3/ldap3/core/exceptions.pyi +++ b/stubs/ldap3/ldap3/core/exceptions.pyi @@ -1,12 +1,13 @@ +from typing_extensions import Self import socket -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from typing import Any class LDAPException(Exception): ... class LDAPOperationResult(LDAPException): def __new__( - cls: type[Self], + cls, result: Incomplete | None = ..., description: Incomplete | None = ..., dn: Incomplete | None = ..., diff --git a/stubs/mock/mock/mock.pyi b/stubs/mock/mock/mock.pyi index 5fd3bdefd404..91eb9fa79f96 100644 --- a/stubs/mock/mock/mock.pyi +++ b/stubs/mock/mock/mock.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from collections.abc import Callable, Coroutine, Mapping, Sequence from contextlib import AbstractContextManager from types import TracebackType @@ -45,7 +46,7 @@ DEFAULT: _SentinelObject class _Call(tuple[Any, ...]): def __new__( - cls: type[Self], + cls, value: Any = ..., name: Incomplete | None = ..., parent: Incomplete | None = ..., @@ -83,7 +84,7 @@ class Base: class NonCallableMock(Base, Any): def __new__( - cls: type[Self], + cls, spec: list[str] | object | type[object] | None = ..., wraps: Incomplete | None = ..., name: str | None = ..., @@ -371,7 +372,7 @@ class _SpecState: def mock_open(mock: Incomplete | None = ..., read_data: Any = ...) -> Any: ... class PropertyMock(Mock): - def __get__(self: Self, obj: _T, obj_type: type[_T] | None = ...) -> Self: ... + def __get__(self, obj: _T, obj_type: type[_T] | None = ...) -> Self: ... def __set__(self, obj: Any, value: Any) -> None: ... def seal(mock: Any) -> None: ... diff --git a/stubs/mypy-extensions/mypy_extensions.pyi b/stubs/mypy-extensions/mypy_extensions.pyi index 195d1cbcaa3a..d4a61a7cff7c 100644 --- a/stubs/mypy-extensions/mypy_extensions.pyi +++ b/stubs/mypy-extensions/mypy_extensions.pyi @@ -1,7 +1,8 @@ +from typing_extensions import Self import abc import sys from _collections_abc import dict_items, dict_keys, dict_values -from _typeshed import IdentityFunction, Self +from _typeshed import IdentityFunction from collections.abc import Mapping from typing import Any, ClassVar, Generic, TypeVar, overload, type_check_only from typing_extensions import Never @@ -16,20 +17,20 @@ class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta): __total__: ClassVar[bool] # Unlike typing(_extensions).TypedDict, # subclasses of mypy_extensions.TypedDict do NOT have the __required_keys__ and __optional_keys__ ClassVars - def copy(self: Self) -> Self: ... + def copy(self) -> Self: ... # Using Never so that only calls using mypy plugin hook that specialize the signature # can go through. def setdefault(self, k: Never, default: object) -> object: ... # Mypy plugin hook for 'pop' expects that 'default' has a type variable type. def pop(self, k: Never, default: _T = ...) -> object: ... # pyright: ignore[reportInvalidTypeVarUse] - def update(self: Self, __m: Self) -> None: ... + def update(self, __m: Self) -> None: ... def items(self) -> dict_items[str, object]: ... def keys(self) -> dict_keys[str, object]: ... def values(self) -> dict_values[str, object]: ... def __delitem__(self, k: Never) -> None: ... if sys.version_info >= (3, 9): - def __or__(self: Self, __other: Self) -> Self: ... - def __ior__(self: Self, __other: Self) -> Self: ... + def __or__(self, __other: Self) -> Self: ... + def __ior__(self, __other: Self) -> Self: ... def TypedDict(typename: str, fields: dict[str, type[Any]], total: bool = ...) -> type[dict[str, Any]]: ... @overload diff --git a/stubs/mysqlclient/MySQLdb/connections.pyi b/stubs/mysqlclient/MySQLdb/connections.pyi index c03fcc594e07..826b26022e09 100644 --- a/stubs/mysqlclient/MySQLdb/connections.pyi +++ b/stubs/mysqlclient/MySQLdb/connections.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from types import TracebackType from typing import Any @@ -27,7 +27,7 @@ class Connection(_mysql.connection): encoding: str messages: Any def __init__(self, *args, **kwargs) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None ) -> None: ... diff --git a/stubs/netaddr/netaddr/eui/__init__.pyi b/stubs/netaddr/netaddr/eui/__init__.pyi index 35340d741295..ee19bced060f 100644 --- a/stubs/netaddr/netaddr/eui/__init__.pyi +++ b/stubs/netaddr/netaddr/eui/__init__.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from typing import ClassVar, SupportsInt, overload from typing_extensions import Literal, SupportsIndex @@ -76,8 +76,8 @@ class EUI(BaseIdentifier): def words(self) -> tuple[int, ...]: ... @property def bin(self) -> str: ... - def eui64(self: Self) -> Self: ... - def modified_eui64(self: Self) -> Self: ... + def eui64(self) -> Self: ... + def modified_eui64(self) -> Self: ... def ipv6(self, prefix: str | SupportsInt | SupportsIndex) -> IPAddress: ... def ipv6_link_local(self) -> IPAddress: ... @property diff --git a/stubs/netaddr/netaddr/ip/__init__.pyi b/stubs/netaddr/netaddr/ip/__init__.pyi index c05525246d8a..d3ae3af2d8f0 100644 --- a/stubs/netaddr/netaddr/ip/__init__.pyi +++ b/stubs/netaddr/netaddr/ip/__init__.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from abc import abstractmethod from collections.abc import Iterable, Iterator from typing import SupportsInt, overload @@ -45,12 +46,12 @@ class IPAddress(BaseIP): def netmask_bits(self) -> int: ... def is_hostmask(self) -> bool: ... def is_netmask(self) -> bool: ... - def __iadd__(self: Self, num: int) -> Self: ... - def __isub__(self: Self, num: int) -> Self: ... - def __add__(self: Self, num: int) -> Self: ... + def __iadd__(self, num: int) -> Self: ... + def __isub__(self, num: int) -> Self: ... + def __add__(self, num: int) -> Self: ... __radd__ = __add__ - def __sub__(self: Self, num: int) -> Self: ... - def __rsub__(self: Self, num: int) -> Self: ... + def __sub__(self, num: int) -> Self: ... + def __rsub__(self, num: int) -> Self: ... def key(self) -> tuple[int, ...]: ... def sort_key(self) -> tuple[int, ...]: ... def __int__(self) -> int: ... @@ -68,14 +69,14 @@ class IPAddress(BaseIP): def bin(self) -> str: ... @property def reverse_dns(self) -> str: ... - def ipv4(self: Self) -> Self: ... - def ipv6(self: Self, ipv4_compatible: bool = ...) -> Self: ... + def ipv4(self) -> Self: ... + def ipv6(self, ipv4_compatible: bool = ...) -> Self: ... def format(self, dialect: type[ipv6_verbose] | None = ...) -> str: ... - def __or__(self: Self, other: str | SupportsInt | SupportsIndex) -> Self: ... - def __and__(self: Self, other: str | SupportsInt | SupportsIndex) -> Self: ... - def __xor__(self: Self, other: str | SupportsInt | SupportsIndex) -> Self: ... - def __lshift__(self: Self, numbits: int) -> Self: ... - def __rshift__(self: Self, numbits: int) -> Self: ... + def __or__(self, other: str | SupportsInt | SupportsIndex) -> Self: ... + def __and__(self, other: str | SupportsInt | SupportsIndex) -> Self: ... + def __xor__(self, other: str | SupportsInt | SupportsIndex) -> Self: ... + def __lshift__(self, numbits: int) -> Self: ... + def __rshift__(self, numbits: int) -> Self: ... def __bool__(self) -> bool: ... class IPListMixin: @@ -122,18 +123,18 @@ class IPNetwork(BaseIP, IPListMixin): def hostmask(self) -> IPAddress: ... @property def cidr(self) -> IPNetwork: ... - def __iadd__(self: Self, num: int) -> Self: ... - def __isub__(self: Self, num: int) -> Self: ... + def __iadd__(self, num: int) -> Self: ... + def __isub__(self, num: int) -> Self: ... # runtime overrides __contains__ with incompatible type for "other" def __contains__(self, other: BaseIP | _IPNetworkAddr) -> bool: ... # type: ignore[override] def key(self) -> tuple[int, ...]: ... def sort_key(self) -> tuple[int, ...]: ... - def ipv4(self: Self) -> Self: ... - def ipv6(self: Self, ipv4_compatible: bool = ...) -> Self: ... - def previous(self: Self, step: int = ...) -> Self: ... - def next(self: Self, step: int = ...) -> Self: ... + def ipv4(self) -> Self: ... + def ipv6(self, ipv4_compatible: bool = ...) -> Self: ... + def previous(self, step: int = ...) -> Self: ... + def next(self, step: int = ...) -> Self: ... def supernet(self, prefixlen: int = ...) -> list[IPNetwork]: ... - def subnet(self: Self, prefixlen: int, count: int | None = ..., fmt: object | None = ...) -> Iterator[Self]: ... + def subnet(self, prefixlen: int, count: int | None = ..., fmt: object | None = ...) -> Iterator[Self]: ... def iter_hosts(self) -> Iterator[IPAddress]: ... class IPRange(BaseIP, IPListMixin): diff --git a/stubs/netaddr/netaddr/ip/sets.pyi b/stubs/netaddr/netaddr/ip/sets.pyi index 36c7e0dff24e..c33573cb36e9 100644 --- a/stubs/netaddr/netaddr/ip/sets.pyi +++ b/stubs/netaddr/netaddr/ip/sets.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from collections.abc import Iterable, Iterator from typing import NoReturn from typing_extensions import TypeAlias @@ -19,7 +19,7 @@ class IPSet: def remove(self, addr: IPRange | _IPNetworkAddr | int, flags: int = ...) -> None: ... def pop(self) -> IPNetwork: ... def isdisjoint(self, other: IPSet) -> bool: ... - def copy(self: Self) -> Self: ... + def copy(self) -> Self: ... def update(self, iterable: _IPIterable, flags: int = ...) -> None: ... def clear(self) -> None: ... def __eq__(self, other: object) -> bool: ... @@ -30,7 +30,7 @@ class IPSet: def __gt__(self, other: IPSet) -> bool: ... def issuperset(self, other: IPSet) -> bool: ... __ge__ = issuperset - def union(self: Self, other: IPSet) -> Self: ... + def union(self, other: IPSet) -> Self: ... __or__ = union def intersection(self, other: IPSet) -> IPSet: ... __and__ = intersection diff --git a/stubs/opentracing/opentracing/mocktracer/context.pyi b/stubs/opentracing/opentracing/mocktracer/context.pyi index ef8ed9214465..4f2cf7cc6ad5 100644 --- a/stubs/opentracing/opentracing/mocktracer/context.pyi +++ b/stubs/opentracing/opentracing/mocktracer/context.pyi @@ -1,5 +1,5 @@ -from _typeshed import Self +from typing_extensions import Self import opentracing class SpanContext(opentracing.SpanContext): @@ -8,4 +8,4 @@ class SpanContext(opentracing.SpanContext): def __init__(self, trace_id: int | None = ..., span_id: int | None = ..., baggage: dict[str, str] | None = ...) -> None: ... @property def baggage(self) -> dict[str, str]: ... - def with_baggage_item(self: Self, key: str, value: str) -> Self: ... + def with_baggage_item(self, key: str, value: str) -> Self: ... diff --git a/stubs/opentracing/opentracing/mocktracer/span.pyi b/stubs/opentracing/opentracing/mocktracer/span.pyi index a54b4d636b5d..e7094eab5d12 100644 --- a/stubs/opentracing/opentracing/mocktracer/span.pyi +++ b/stubs/opentracing/opentracing/mocktracer/span.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from typing import Any from ..span import Span @@ -27,10 +27,10 @@ class MockSpan(Span): def tracer(self) -> MockTracer: ... @property def context(self) -> SpanContext: ... - def set_operation_name(self: Self, operation_name: str) -> Self: ... - def set_tag(self: Self, key: str, value: str | bool | float) -> Self: ... - def log_kv(self: Self, key_values: dict[str, Any], timestamp: float | None = ...) -> Self: ... - def set_baggage_item(self: Self, key: str, value: str) -> Self: ... + def set_operation_name(self, operation_name: str) -> Self: ... + def set_tag(self, key: str, value: str | bool | float) -> Self: ... + def log_kv(self, key_values: dict[str, Any], timestamp: float | None = ...) -> Self: ... + def set_baggage_item(self, key: str, value: str) -> Self: ... class LogData: key_values: dict[str, Any] diff --git a/stubs/opentracing/opentracing/scope.pyi b/stubs/opentracing/opentracing/scope.pyi index d3ed839fe188..77b0568348f0 100644 --- a/stubs/opentracing/opentracing/scope.pyi +++ b/stubs/opentracing/opentracing/scope.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from types import TracebackType from .scope_manager import ScopeManager @@ -11,7 +11,7 @@ class Scope: @property def manager(self) -> ScopeManager: ... def close(self) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... diff --git a/stubs/opentracing/opentracing/span.pyi b/stubs/opentracing/opentracing/span.pyi index 6a6eb637e064..f0ef7c59fa57 100644 --- a/stubs/opentracing/opentracing/span.pyi +++ b/stubs/opentracing/opentracing/span.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from types import TracebackType from typing import Any @@ -15,15 +16,15 @@ class Span: def context(self) -> SpanContext: ... @property def tracer(self) -> Tracer: ... - def set_operation_name(self: Self, operation_name: str) -> Self: ... + def set_operation_name(self, operation_name: str) -> Self: ... def finish(self, finish_time: float | None = ...) -> None: ... - def set_tag(self: Self, key: str, value: str | bool | float) -> Self: ... - def log_kv(self: Self, key_values: dict[str, Any], timestamp: float | None = ...) -> Self: ... - def set_baggage_item(self: Self, key: str, value: str) -> Self: ... + def set_tag(self, key: str, value: str | bool | float) -> Self: ... + def log_kv(self, key_values: dict[str, Any], timestamp: float | None = ...) -> Self: ... + def set_baggage_item(self, key: str, value: str) -> Self: ... def get_baggage_item(self, key: str) -> str | None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... - def log_event(self: Self, event: Any, payload: Incomplete | None = ...) -> Self: ... - def log(self: Self, **kwargs: Any) -> Self: ... + def log_event(self, event: Any, payload: Incomplete | None = ...) -> Self: ... + def log(self, **kwargs: Any) -> Self: ... diff --git a/stubs/paramiko/paramiko/_winapi.pyi b/stubs/paramiko/paramiko/_winapi.pyi index d4dc8166a956..7017df87450f 100644 --- a/stubs/paramiko/paramiko/_winapi.pyi +++ b/stubs/paramiko/paramiko/_winapi.pyi @@ -1,7 +1,8 @@ +from typing_extensions import Self import builtins import ctypes import sys -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from types import TracebackType from typing import Any @@ -34,7 +35,7 @@ if sys.platform == "win32": filemap: Any = ... view: Any = ... def __init__(self, name: str, length: int, security_attributes: Incomplete | None = ...) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def seek(self, pos: int) -> None: ... def write(self, msg: bytes) -> None: ... def read(self, n: int) -> bytes: ... diff --git a/stubs/paramiko/paramiko/config.pyi b/stubs/paramiko/paramiko/config.pyi index b0b6078f410c..509920cbd309 100644 --- a/stubs/paramiko/paramiko/config.pyi +++ b/stubs/paramiko/paramiko/config.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from collections.abc import Iterable from re import Pattern from typing import IO @@ -12,11 +12,11 @@ class SSHConfig: TOKENS_BY_CONFIG_KEY: dict[str, list[str]] def __init__(self) -> None: ... @classmethod - def from_text(cls: type[Self], text: str) -> Self: ... + def from_text(cls, text: str) -> Self: ... @classmethod - def from_path(cls: type[Self], path: str) -> Self: ... + def from_path(cls, path: str) -> Self: ... @classmethod - def from_file(cls: type[Self], flo: IO[str]) -> Self: ... + def from_file(cls, flo: IO[str]) -> Self: ... def parse(self, file_obj: IO[str]) -> None: ... def lookup(self, hostname: str) -> SSHConfigDict: ... def canonicalize(self, hostname: str, options: SSHConfigDict, domains: Iterable[str]) -> str: ... diff --git a/stubs/paramiko/paramiko/hostkeys.pyi b/stubs/paramiko/paramiko/hostkeys.pyi index 96d9d4816aab..f66e4403cf63 100644 --- a/stubs/paramiko/paramiko/hostkeys.pyi +++ b/stubs/paramiko/paramiko/hostkeys.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from collections.abc import Iterator, Mapping, MutableMapping from paramiko.pkey import PKey @@ -42,5 +42,5 @@ class HostKeyEntry: key: PKey def __init__(self, hostnames: list[str] | None = ..., key: PKey | None = ...) -> None: ... @classmethod - def from_line(cls: type[Self], line: str, lineno: int | None = ...) -> Self | None: ... + def from_line(cls, line: str, lineno: int | None = ...) -> Self | None: ... def to_line(self) -> str | None: ... diff --git a/stubs/paramiko/paramiko/pkey.pyi b/stubs/paramiko/paramiko/pkey.pyi index 3d58dc9b0802..9d1a6555de9f 100644 --- a/stubs/paramiko/paramiko/pkey.pyi +++ b/stubs/paramiko/paramiko/pkey.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from re import Pattern from typing import IO @@ -24,9 +24,9 @@ class PKey: def sign_ssh_data(self, data: bytes, algorithm: str | None = ...) -> Message: ... def verify_ssh_sig(self, data: bytes, msg: Message) -> bool: ... @classmethod - def from_private_key_file(cls: type[Self], filename: str, password: str | None = ...) -> Self: ... + def from_private_key_file(cls, filename: str, password: str | None = ...) -> Self: ... @classmethod - def from_private_key(cls: type[Self], file_obj: IO[str], password: str | None = ...) -> Self: ... + def from_private_key(cls, file_obj: IO[str], password: str | None = ...) -> Self: ... def write_private_key_file(self, filename: str, password: str | None = ...) -> None: ... def write_private_key(self, file_obj: IO[str], password: str | None = ...) -> None: ... def load_certificate(self, value: Message | str) -> None: ... @@ -37,10 +37,10 @@ class PublicBlob: comment: str def __init__(self, type_: str, blob: bytes, comment: str | None = ...) -> None: ... @classmethod - def from_file(cls: type[Self], filename: str) -> Self: ... + def from_file(cls, filename: str) -> Self: ... @classmethod - def from_string(cls: type[Self], string: str) -> Self: ... + def from_string(cls, string: str) -> Self: ... @classmethod - def from_message(cls: type[Self], message: Message) -> Self: ... + def from_message(cls, message: Message) -> Self: ... def __eq__(self, other: object) -> bool: ... def __ne__(self, other: object) -> bool: ... diff --git a/stubs/paramiko/paramiko/sftp_attr.pyi b/stubs/paramiko/paramiko/sftp_attr.pyi index 3a397ff7168c..68363587dddb 100644 --- a/stubs/paramiko/paramiko/sftp_attr.pyi +++ b/stubs/paramiko/paramiko/sftp_attr.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from os import stat_result class SFTPAttributes: @@ -18,5 +18,5 @@ class SFTPAttributes: attr: dict[str, str] def __init__(self) -> None: ... @classmethod - def from_stat(cls: type[Self], obj: stat_result, filename: str | None = ...) -> Self: ... + def from_stat(cls, obj: stat_result, filename: str | None = ...) -> Self: ... def asbytes(self) -> bytes: ... diff --git a/stubs/paramiko/paramiko/sftp_client.pyi b/stubs/paramiko/paramiko/sftp_client.pyi index ebaa92cb7ca4..904e40887d6b 100644 --- a/stubs/paramiko/paramiko/sftp_client.pyi +++ b/stubs/paramiko/paramiko/sftp_client.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from collections.abc import Callable, Iterator from logging import Logger from typing import IO @@ -23,7 +23,7 @@ class SFTPClient(BaseSFTP, ClosingContextManager): def __init__(self, sock: Channel) -> None: ... @classmethod def from_transport( - cls: type[Self], t: Transport, window_size: int | None = ..., max_packet_size: int | None = ... + cls, t: Transport, window_size: int | None = ..., max_packet_size: int | None = ... ) -> Self | None: ... def close(self) -> None: ... def get_channel(self) -> Channel | None: ... diff --git a/stubs/paramiko/paramiko/util.pyi b/stubs/paramiko/paramiko/util.pyi index 723bbde7bdc1..8dbda68dfe6b 100644 --- a/stubs/paramiko/paramiko/util.pyi +++ b/stubs/paramiko/paramiko/util.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from hashlib import _Hash from logging import Logger, LogRecord from types import TracebackType @@ -32,7 +32,7 @@ def get_logger(name: str) -> Logger: ... def constant_time_bytes_eq(a: AnyStr, b: AnyStr) -> bool: ... class ClosingContextManager: - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... diff --git a/stubs/parsimonious/parsimonious/expressions.pyi b/stubs/parsimonious/parsimonious/expressions.pyi index 482390b14f63..ba4ee5debb2e 100644 --- a/stubs/parsimonious/parsimonious/expressions.pyi +++ b/stubs/parsimonious/parsimonious/expressions.pyi @@ -1,5 +1,5 @@ +from typing_extensions import Self import collections.abc -from _typeshed import Self from collections.abc import Callable, Mapping from re import Pattern from typing import Any @@ -25,7 +25,7 @@ class Expression(StrAndRepr): name: str identity_tuple: tuple[str] def __init__(self, name: str = ...) -> None: ... - def resolve_refs(self: Self, rule_map: Mapping[str, Expression]) -> Self: ... + def resolve_refs(self, rule_map: Mapping[str, Expression]) -> Self: ... def parse(self, text: str, pos: int = ...) -> Node: ... def match(self, text: str, pos: int = ...) -> Node: ... def match_core(self, text: str, pos: int, cache: Mapping[tuple[int, int], Node], error: ParseError) -> Node: ... diff --git a/stubs/passlib/passlib/context.pyi b/stubs/passlib/passlib/context.pyi index d672e5b4a9a0..e5e7741ec206 100644 --- a/stubs/passlib/passlib/context.pyi +++ b/stubs/passlib/passlib/context.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self, StrOrBytesPath, SupportsItems +from typing_extensions import Self +from _typeshed import Incomplete, StrOrBytesPath, SupportsItems from typing import Any class CryptPolicy: @@ -26,9 +27,9 @@ class CryptPolicy: class CryptContext: @classmethod - def from_string(cls: type[Self], source: str | bytes, section: str = ..., encoding: str = ...) -> Self: ... + def from_string(cls, source: str | bytes, section: str = ..., encoding: str = ...) -> Self: ... @classmethod - def from_path(cls: type[Self], path: StrOrBytesPath, section: str = ..., encoding: str = ...) -> Self: ... + def from_path(cls, path: StrOrBytesPath, section: str = ..., encoding: str = ...) -> Self: ... def copy(self, **kwds: Any) -> CryptContext: ... def using(self, **kwds: Any) -> CryptContext: ... def replace(self, **kwds): ... diff --git a/stubs/passlib/passlib/handlers/pbkdf2.pyi b/stubs/passlib/passlib/handlers/pbkdf2.pyi index c28854b56114..993f83c5f250 100644 --- a/stubs/passlib/passlib/handlers/pbkdf2.pyi +++ b/stubs/passlib/passlib/handlers/pbkdf2.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from typing import ClassVar import passlib.utils.handlers as uh @@ -13,7 +13,7 @@ class Pbkdf2DigestHandler(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.Gen max_rounds: ClassVar[int] rounds_cost: ClassVar[str] @classmethod - def from_string(cls: type[Self], hash: str | bytes) -> Self: ... # type: ignore[override] + def from_string(cls, hash: str | bytes) -> Self: ... # type: ignore[override] # dynamically created by create_pbkdf2_hash() class pbkdf2_sha1(Pbkdf2DigestHandler): diff --git a/stubs/passlib/passlib/handlers/phpass.pyi b/stubs/passlib/passlib/handlers/phpass.pyi index 93a24edb7c47..b98efd917d48 100644 --- a/stubs/passlib/passlib/handlers/phpass.pyi +++ b/stubs/passlib/passlib/handlers/phpass.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from typing import ClassVar import passlib.utils.handlers as uh @@ -17,4 +17,4 @@ class phpass(uh.HasManyIdents, uh.HasRounds, uh.HasSalt, uh.GenericHandler): # ident_values: ClassVar[tuple[str, ...]] ident_aliases: ClassVar[dict[str, str]] @classmethod - def from_string(cls: type[Self], hash: str | bytes) -> Self: ... # type: ignore[override] + def from_string(cls, hash: str | bytes) -> Self: ... # type: ignore[override] diff --git a/stubs/passlib/passlib/handlers/sha1_crypt.pyi b/stubs/passlib/passlib/handlers/sha1_crypt.pyi index 601f616bfb20..b5daa4ca72d0 100644 --- a/stubs/passlib/passlib/handlers/sha1_crypt.pyi +++ b/stubs/passlib/passlib/handlers/sha1_crypt.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from typing import Any, ClassVar import passlib.utils.handlers as uh @@ -18,6 +18,6 @@ class sha1_crypt(uh.HasManyBackends, uh.HasRounds, uh.HasSalt, uh.GenericHandler max_rounds: ClassVar[int] rounds_cost: ClassVar[str] @classmethod - def from_string(cls: type[Self], hash: str | bytes) -> Self: ... # type: ignore[override] + def from_string(cls, hash: str | bytes) -> Self: ... # type: ignore[override] def to_string(self, config: bool = ...) -> str: ... backends: ClassVar[tuple[str, ...]] diff --git a/stubs/passlib/passlib/handlers/sha2_crypt.pyi b/stubs/passlib/passlib/handlers/sha2_crypt.pyi index 849d7f677af9..ff8d7261e85e 100644 --- a/stubs/passlib/passlib/handlers/sha2_crypt.pyi +++ b/stubs/passlib/passlib/handlers/sha2_crypt.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from typing import ClassVar import passlib.utils.handlers as uh @@ -13,7 +13,7 @@ class _SHA2_Common(uh.HasManyBackends, uh.HasRounds, uh.HasSalt, uh.GenericHandl implicit_rounds: bool def __init__(self, implicit_rounds: bool | None = ..., **kwds) -> None: ... @classmethod - def from_string(cls: type[Self], hash: str | bytes) -> Self: ... # type: ignore[override] + def from_string(cls, hash: str | bytes) -> Self: ... # type: ignore[override] backends: ClassVar[tuple[str, ...]] class sha256_crypt(_SHA2_Common): diff --git a/stubs/passlib/passlib/handlers/sun_md5_crypt.pyi b/stubs/passlib/passlib/handlers/sun_md5_crypt.pyi index 9436095c31db..ebd0c80cc53d 100644 --- a/stubs/passlib/passlib/handlers/sun_md5_crypt.pyi +++ b/stubs/passlib/passlib/handlers/sun_md5_crypt.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from typing import ClassVar import passlib.utils.handlers as uh @@ -20,5 +20,5 @@ class sun_md5_crypt(uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignor @classmethod def identify(cls, hash): ... @classmethod - def from_string(cls: type[Self], hash: str | bytes) -> Self: ... # type: ignore[override] + def from_string(cls, hash: str | bytes) -> Self: ... # type: ignore[override] def to_string(self, _withchk: bool = ...) -> str: ... diff --git a/stubs/passlib/passlib/ifc.pyi b/stubs/passlib/passlib/ifc.pyi index 7f477cfee654..95e99248e680 100644 --- a/stubs/passlib/passlib/ifc.pyi +++ b/stubs/passlib/passlib/ifc.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from abc import ABCMeta, abstractmethod from typing import Any, ClassVar from typing_extensions import Literal @@ -18,7 +18,7 @@ class PasswordHash(metaclass=ABCMeta): def verify(cls, secret: str | bytes, hash: str | bytes, **context_kwds): ... @classmethod @abstractmethod - def using(cls: type[Self], relaxed: bool = ..., **kwds: Any) -> type[Self]: ... + def using(cls, relaxed: bool = ..., **kwds: Any) -> type[Self]: ... @classmethod def needs_update(cls, hash: str, secret: str | bytes | None = ...) -> bool: ... @classmethod diff --git a/stubs/passlib/passlib/utils/handlers.pyi b/stubs/passlib/passlib/utils/handlers.pyi index 59416d7e2bc1..3b6cbb0995ec 100644 --- a/stubs/passlib/passlib/utils/handlers.pyi +++ b/stubs/passlib/passlib/utils/handlers.pyi @@ -1,5 +1,6 @@ +from typing_extensions import Self import abc -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from typing import Any, ClassVar from passlib.ifc import PasswordHash @@ -20,13 +21,13 @@ def render_mc3(ident, rounds, salt, checksum, sep=..., rounds_base: int = ...): class MinimalHandler(PasswordHash, metaclass=abc.ABCMeta): @classmethod - def using(cls: Self, relaxed: bool = ...) -> type[Self]: ... # type: ignore[override] + def using(cls, relaxed: bool = ...) -> type[Self]: ... # type: ignore[override] class TruncateMixin(MinimalHandler, metaclass=abc.ABCMeta): truncate_error: ClassVar[bool] truncate_verify_reject: ClassVar[bool] @classmethod - def using(cls: type[Self], truncate_error: object = ..., *, relaxed: bool = ...) -> type[Self]: ... # type: ignore[override] + def using(cls, truncate_error: object = ..., *, relaxed: bool = ...) -> type[Self]: ... # type: ignore[override] class GenericHandler(MinimalHandler): setting_kwds: ClassVar[tuple[str, ...]] @@ -40,7 +41,7 @@ class GenericHandler(MinimalHandler): @classmethod def identify(cls, hash: str | bytes) -> bool: ... @classmethod - def from_string(cls: type[Self], hash: str | bytes, **context: Any) -> Self: ... + def from_string(cls, hash: str | bytes, **context: Any) -> Self: ... def to_string(self) -> str: ... @classmethod def hash(cls, secret: str | bytes, **kwds: Any) -> str: ... diff --git a/stubs/peewee/peewee.pyi b/stubs/peewee/peewee.pyi index 8433d59fb1f7..456be3281ccb 100644 --- a/stubs/peewee/peewee.pyi +++ b/stubs/peewee/peewee.pyi @@ -1,7 +1,8 @@ +from typing_extensions import Self import itertools import logging import threading -from _typeshed import Incomplete, Self, SupportsKeysAndGetItem +from _typeshed import Incomplete, SupportsKeysAndGetItem from collections.abc import Generator, Iterable from typing import ClassVar, NamedTuple, TypeVar @@ -21,7 +22,7 @@ class attrdict(dict[str, _VT]): def __getattr__(self, attr: str) -> _VT: ... def __setattr__(self, attr: str, value: _VT) -> None: ... # calls dict.update() - def __iadd__(self: Self, rhs: SupportsKeysAndGetItem[str, _VT] | Iterable[tuple[str, _VT]]) -> Self: ... + def __iadd__(self, rhs: SupportsKeysAndGetItem[str, _VT] | Iterable[tuple[str, _VT]]) -> Self: ... def __add__(self, rhs: SupportsKeysAndGetItem[str, _VT] | Iterable[tuple[str, _VT]]) -> attrdict[_VT]: ... OP: Incomplete diff --git a/stubs/pika/pika/adapters/asyncio_connection.pyi b/stubs/pika/pika/adapters/asyncio_connection.pyi index 57a3257cd565..90c6592709ba 100644 --- a/stubs/pika/pika/adapters/asyncio_connection.pyi +++ b/stubs/pika/pika/adapters/asyncio_connection.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from asyncio import AbstractEventLoop from collections.abc import Callable from logging import Logger @@ -11,7 +12,7 @@ LOGGER: Logger class AsyncioConnection(BaseConnection): def __init__( - self: Self, + self, parameters: Parameters | None = ..., on_open_callback: Callable[[Self], object] | None = ..., on_open_error_callback: Callable[[Self, BaseException], object] | None = ..., diff --git a/stubs/pika/pika/adapters/base_connection.pyi b/stubs/pika/pika/adapters/base_connection.pyi index 3cf7ed97f354..4fc4b47b440b 100644 --- a/stubs/pika/pika/adapters/base_connection.pyi +++ b/stubs/pika/pika/adapters/base_connection.pyi @@ -1,5 +1,6 @@ +from typing_extensions import Self import abc -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from collections.abc import Callable from ..adapters.utils import nbio_interface @@ -9,7 +10,7 @@ LOGGER: Incomplete class BaseConnection(Connection, metaclass=abc.ABCMeta): def __init__( - self: Self, + self, parameters, on_open_callback: Callable[[Self], object] | None, on_open_error_callback: Callable[[Self, BaseException], object] | None, diff --git a/stubs/pika/pika/adapters/blocking_connection.pyi b/stubs/pika/pika/adapters/blocking_connection.pyi index c0907f2f37d9..20591a17800f 100644 --- a/stubs/pika/pika/adapters/blocking_connection.pyi +++ b/stubs/pika/pika/adapters/blocking_connection.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from collections.abc import Generator, Sequence from typing import NamedTuple @@ -55,7 +56,7 @@ class BlockingConnection: def __init__( self, parameters: Parameters | Sequence[Parameters] | None = ..., _impl_class: Incomplete | None = ... ) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, exc_type: object, value: object, traceback: object) -> None: ... def add_on_connection_blocked_callback(self, callback) -> None: ... def add_on_connection_unblocked_callback(self, callback) -> None: ... diff --git a/stubs/pika/pika/channel.pyi b/stubs/pika/pika/channel.pyi index 30631f00fdaa..9ef9dd603fda 100644 --- a/stubs/pika/pika/channel.pyi +++ b/stubs/pika/pika/channel.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from collections.abc import Callable from logging import Logger from typing import Any @@ -25,7 +26,7 @@ class Channel: connection: Connection flow_active: bool - def __init__(self: Self, connection: Connection, channel_number: int, on_open_callback: Callable[[Self], object]) -> None: ... + def __init__(self, connection: Connection, channel_number: int, on_open_callback: Callable[[Self], object]) -> None: ... def __int__(self) -> int: ... def add_callback(self, callback, replies, one_shot: bool = ...) -> None: ... def add_on_cancel_callback(self, callback) -> None: ... diff --git a/stubs/pika/pika/connection.pyi b/stubs/pika/pika/connection.pyi index 97a10c698fa8..34831ba0153b 100644 --- a/stubs/pika/pika/connection.pyi +++ b/stubs/pika/pika/connection.pyi @@ -1,5 +1,6 @@ +from typing_extensions import Self import abc -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from collections.abc import Callable from logging import Logger from typing_extensions import Final @@ -150,23 +151,23 @@ class Connection(AbstractBase, metaclass=abc.ABCMeta): server_properties: Incomplete known_hosts: Incomplete def __init__( - self: Self, + self, parameters: Parameters | None = ..., on_open_callback: Callable[[Self], object] | None = ..., on_open_error_callback: Callable[[Self, BaseException], object] | None = ..., on_close_callback: Callable[[Self, BaseException], object] | None = ..., internal_connection_workflow: bool = ..., ) -> None: ... - def add_on_close_callback(self: Self, callback: Callable[[Self, BaseException], object]) -> None: ... + def add_on_close_callback(self, callback: Callable[[Self, BaseException], object]) -> None: ... def add_on_connection_blocked_callback( - self: Self, callback: Callable[[Self, Method[SpecConnection.Blocked]], object] + self, callback: Callable[[Self, Method[SpecConnection.Blocked]], object] ) -> None: ... def add_on_connection_unblocked_callback( - self: Self, callback: Callable[[Self, Method[SpecConnection.Unblocked]], object] + self, callback: Callable[[Self, Method[SpecConnection.Unblocked]], object] ) -> None: ... - def add_on_open_callback(self: Self, callback: Callable[[Self], object]) -> None: ... + def add_on_open_callback(self, callback: Callable[[Self], object]) -> None: ... def add_on_open_error_callback( - self: Self, callback: Callable[[Self, BaseException], object], remove_default: bool = ... + self, callback: Callable[[Self, BaseException], object], remove_default: bool = ... ) -> None: ... def channel( self, channel_number: int | None = ..., on_open_callback: Callable[[Channel], object] | None = ... diff --git a/stubs/pika/pika/spec.pyi b/stubs/pika/pika/spec.pyi index d0b6bf1227c8..39a1b4999ef9 100644 --- a/stubs/pika/pika/spec.pyi +++ b/stubs/pika/pika/spec.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from typing import ClassVar from typing_extensions import Literal, TypeAlias @@ -339,7 +340,7 @@ class Exchange(Class): def __init__(self) -> None: ... @property def synchronous(self) -> Literal[False]: ... - def decode(self: Self, encoded: bytes, offset: int = ...) -> Self: ... + def decode(self, encoded: bytes, offset: int = ...) -> Self: ... def encode(self) -> list[bytes]: ... class Delete(Method): @@ -450,7 +451,7 @@ class Queue(Class): ) -> None: ... @property def synchronous(self) -> Literal[True]: ... - def decode(self: Self, encoded: bytes, offset: int = ...) -> Self: ... + def decode(self, encoded: bytes, offset: int = ...) -> Self: ... def encode(self) -> list[bytes]: ... class DeclareOk(Method): @@ -461,7 +462,7 @@ class Queue(Class): def __init__(self, queue: _str, message_count: int, consumer_count: int) -> None: ... @property def synchronous(self) -> Literal[False]: ... - def decode(self: Self, encoded: bytes, offset: int = ...) -> Self: ... + def decode(self, encoded: bytes, offset: int = ...) -> Self: ... def encode(self) -> list[bytes]: ... class Bind(Method): diff --git a/stubs/protobuf/google/protobuf/message.pyi b/stubs/protobuf/google/protobuf/message.pyi index 8a90d7c96102..ae495cf073b3 100644 --- a/stubs/protobuf/google/protobuf/message.pyi +++ b/stubs/protobuf/google/protobuf/message.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from collections.abc import Sequence from typing import Any, TypeVar @@ -13,11 +13,11 @@ _M = TypeVar("_M", bound=Message) # message type (of self) class Message: DESCRIPTOR: Descriptor - def __deepcopy__(self: Self, memo: Any = ...) -> Self: ... + def __deepcopy__(self, memo: Any = ...) -> Self: ... def __eq__(self, other_msg): ... def __ne__(self, other_msg): ... - def MergeFrom(self: Self, other_msg: Self) -> None: ... - def CopyFrom(self: Self, other_msg: Self) -> None: ... + def MergeFrom(self, other_msg: Self) -> None: ... + def CopyFrom(self, other_msg: Self) -> None: ... def Clear(self) -> None: ... def SetInParent(self) -> None: ... def IsInitialized(self) -> bool: ... @@ -34,7 +34,7 @@ class Message: def Extensions(self: _M) -> _ExtensionDict[_M]: ... def ByteSize(self) -> int: ... @classmethod - def FromString(cls: type[Self], s: bytes) -> Self: ... + def FromString(cls, s: bytes) -> Self: ... # Intentionally left out typing on these three methods, because they are # stringly typed and it is not useful to call them on a Message directly. # We prefer more specific typing on individual subclasses of Message diff --git a/stubs/psutil/psutil/__init__.pyi b/stubs/psutil/psutil/__init__.pyi index 81f8d95c288f..a37c2ec34638 100644 --- a/stubs/psutil/psutil/__init__.pyi +++ b/stubs/psutil/psutil/__init__.pyi @@ -1,5 +1,6 @@ +from typing_extensions import Self import sys -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from collections.abc import Callable, Iterable, Iterator from contextlib import AbstractContextManager from typing import Any, overload @@ -217,7 +218,7 @@ class Process: class Popen(Process): def __init__(self, *args, **kwargs) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, *args, **kwargs) -> None: ... def __getattribute__(self, name: str) -> Any: ... diff --git a/stubs/psycopg2/psycopg2/_psycopg.pyi b/stubs/psycopg2/psycopg2/_psycopg.pyi index f9bd4e3ebe25..c45a16f99102 100644 --- a/stubs/psycopg2/psycopg2/_psycopg.pyi +++ b/stubs/psycopg2/psycopg2/_psycopg.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from collections.abc import Callable, Iterable, Mapping, Sequence from types import TracebackType from typing import Any, TypeVar, overload @@ -105,11 +105,11 @@ class cursor: def scroll(self, value, mode=...): ... def setinputsizes(self, sizes): ... def setoutputsize(self, size, column=...): ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> tuple[Any, ...]: ... _Cursor: TypeAlias = cursor @@ -462,7 +462,7 @@ class connection: def tpc_recover(self) -> list[Xid]: ... def tpc_rollback(self, __xid: str | bytes | Xid = ...) -> None: ... def xid(self, format_id, gtrid, bqual) -> Xid: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, __type: object, __name: object, __tb: object) -> None: ... class lobject: diff --git a/stubs/pyRFC3339/pyrfc3339/utils.pyi b/stubs/pyRFC3339/pyrfc3339/utils.pyi index d71f3c94e039..29c7be3b8b9f 100644 --- a/stubs/pyRFC3339/pyrfc3339/utils.pyi +++ b/stubs/pyRFC3339/pyrfc3339/utils.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from datetime import datetime, timedelta, tzinfo from typing import Any @@ -7,7 +7,7 @@ class FixedOffset(tzinfo): def dst(self, dt: datetime | None) -> timedelta: ... def utcoffset(self, dt: datetime | None) -> timedelta: ... def tzname(self, dt: datetime | None) -> str: ... - def __deepcopy__(self: Self, memo: dict[int, Any]) -> Self: ... + def __deepcopy__(self, memo: dict[int, Any]) -> Self: ... def timedelta_seconds(td: timedelta) -> int: ... def timezone(utcoffset: float) -> str: ... diff --git a/stubs/pyasn1/pyasn1/type/univ.pyi b/stubs/pyasn1/pyasn1/type/univ.pyi index c2e3ff45ab1b..9061b14af628 100644 --- a/stubs/pyasn1/pyasn1/type/univ.pyi +++ b/stubs/pyasn1/pyasn1/type/univ.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, ReadableBuffer, Self, SupportsRichComparison, SupportsTrunc +from typing_extensions import Self +from _typeshed import Incomplete, ReadableBuffer, SupportsRichComparison, SupportsTrunc from collections.abc import Callable, Generator from typing import SupportsInt from typing_extensions import SupportsIndex, TypeAlias @@ -34,7 +35,7 @@ class Integer(base.SimpleAsn1Type): def __mod__(self, value): ... def __rmod__(self, value): ... # Accepts everything builtins.pow does - def __pow__(self: Self, value: complex, modulo: int | None = ...) -> Self: ... + def __pow__(self, value: complex, modulo: int | None = ...) -> Self: ... def __rpow__(self, value): ... def __floordiv__(self, value): ... def __rfloordiv__(self, value): ... @@ -190,7 +191,7 @@ class Real(base.SimpleAsn1Type): def __mod__(self, value): ... def __rmod__(self, value): ... # Accepts everything builtins.pow with a float base does - def __pow__(self: Self, value: complex, modulo: int | None = ...) -> Self: ... + def __pow__(self, value: complex, modulo: int | None = ...) -> Self: ... def __rpow__(self, value): ... def __truediv__(self, value): ... def __rtruediv__(self, value): ... diff --git a/stubs/pycurl/pycurl.pyi b/stubs/pycurl/pycurl.pyi index 65fdf8b5c708..afb2586f28fc 100644 --- a/stubs/pycurl/pycurl.pyi +++ b/stubs/pycurl/pycurl.pyi @@ -1,5 +1,6 @@ +from typing_extensions import Self import sys -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from typing_extensions import final version: str @@ -27,7 +28,7 @@ class Curl: def unsetopt(self, option: int) -> Incomplete: ... def pause(self, bitmask: Incomplete) -> Incomplete: ... def errstr(self) -> str: ... - def duphandle(self: Self) -> Self: ... + def duphandle(self) -> Self: ... def errstr_raw(self) -> bytes: ... def set_ca_certs(self, __value: bytes | str) -> None: ... diff --git a/stubs/pyinstaller/PyInstaller/isolated/_parent.pyi b/stubs/pyinstaller/PyInstaller/isolated/_parent.pyi index 40924db08580..c70307a26a2b 100644 --- a/stubs/pyinstaller/PyInstaller/isolated/_parent.pyi +++ b/stubs/pyinstaller/PyInstaller/isolated/_parent.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from collections.abc import Callable from types import TracebackType from typing import TypeVar @@ -10,7 +10,7 @@ _P = ParamSpec("_P") class Python: def __init__(self, strict_mode: bool | None = None) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... diff --git a/stubs/pynput/pynput/_util.pyi b/stubs/pynput/pynput/_util.pyi index 4202bcb5464e..9631a177ed71 100644 --- a/stubs/pynput/pynput/_util.pyi +++ b/stubs/pynput/pynput/_util.pyi @@ -1,6 +1,6 @@ +from typing_extensions import Self import sys import threading -from _typeshed import Self from collections.abc import Callable from queue import Queue from types import ModuleType, TracebackType @@ -37,7 +37,7 @@ class AbstractListener(threading.Thread): @property def running(self) -> bool: ... def stop(self) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... @@ -60,11 +60,11 @@ class Events(Generic[_T, _AbstractListener_T]): _listener: _AbstractListener_T # undocumented start: Callable[[], None] def __init__(self, *args: Any, **kwargs: Any) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> _T: ... def get(self, timeout: float | None = ...) -> _T | None: ... def _event_mapper(self, event: Callable[_P, object]) -> Callable[_P, None]: ... diff --git a/stubs/pynput/pynput/keyboard/_base.pyi b/stubs/pynput/pynput/keyboard/_base.pyi index 0ab78d393a92..3c82646f50a3 100644 --- a/stubs/pynput/pynput/keyboard/_base.pyi +++ b/stubs/pynput/pynput/keyboard/_base.pyi @@ -1,7 +1,7 @@ +from typing_extensions import Self import contextlib import enum import sys -from _typeshed import Self from collections.abc import Callable, Iterable, Iterator from typing import Any, ClassVar @@ -16,13 +16,13 @@ class KeyCode: def __init__(self, vk: str | None = ..., char: str | None = ..., is_dead: bool = ..., **kwargs: str) -> None: ... def __eq__(self, other: object) -> bool: ... def __hash__(self) -> int: ... - def join(self: Self, key: Self) -> Self: ... + def join(self, key: Self) -> Self: ... @classmethod - def from_vk(cls: type[Self], vk: int, **kwargs: Any) -> Self: ... + def from_vk(cls, vk: int, **kwargs: Any) -> Self: ... @classmethod - def from_char(cls: type[Self], char: str, **kwargs: Any) -> Self: ... + def from_char(cls, char: str, **kwargs: Any) -> Self: ... @classmethod - def from_dead(cls: type[Self], char: str, **kwargs: Any) -> Self: ... + def from_dead(cls, char: str, **kwargs: Any) -> Self: ... class Key(enum.Enum): alt: int diff --git a/stubs/pynput/pynput/mouse/_base.pyi b/stubs/pynput/pynput/mouse/_base.pyi index dae183d15307..326f64bec4cf 100644 --- a/stubs/pynput/pynput/mouse/_base.pyi +++ b/stubs/pynput/pynput/mouse/_base.pyi @@ -1,6 +1,6 @@ +from typing_extensions import Self import enum import sys -from _typeshed import Self from collections.abc import Callable from types import TracebackType from typing import Any @@ -55,7 +55,7 @@ class Controller: def release(self, button: Button) -> None: ... def move(self, dx: int, dy: int) -> None: ... def click(self, button: Button, count: int = ...) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... diff --git a/stubs/pyserial/serial/threaded/__init__.pyi b/stubs/pyserial/serial/threaded/__init__.pyi index 93ebbac85ee5..12216f75713c 100644 --- a/stubs/pyserial/serial/threaded/__init__.pyi +++ b/stubs/pyserial/serial/threaded/__init__.pyi @@ -1,5 +1,6 @@ +from typing_extensions import Self import threading -from _typeshed import ReadableBuffer, Self +from _typeshed import ReadableBuffer from collections.abc import Callable from serial import Serial @@ -39,6 +40,6 @@ class ReaderThread(threading.Thread): def stop(self) -> None: ... def write(self, data: ReadableBuffer) -> int: ... def close(self) -> None: ... - def connect(self: Self) -> tuple[Self, Protocol]: ... + def connect(self) -> tuple[Self, Protocol]: ... def __enter__(self) -> Protocol: ... def __exit__(self, __exc_type: object, __exc_val: object, __exc_tb: object) -> None: ... diff --git a/stubs/pyserial/serial/tools/miniterm.pyi b/stubs/pyserial/serial/tools/miniterm.pyi index b61668f5a2d3..fbc660dcf717 100644 --- a/stubs/pyserial/serial/tools/miniterm.pyi +++ b/stubs/pyserial/serial/tools/miniterm.pyi @@ -1,7 +1,7 @@ +from typing_extensions import Self import codecs import sys import threading -from _typeshed import Self from collections.abc import Iterable from typing import Any, BinaryIO, TextIO @@ -19,7 +19,7 @@ class ConsoleBase: def write_bytes(self, byte_string: bytes) -> None: ... def write(self, text: str) -> None: ... def cancel(self) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, *args: object, **kwargs: object) -> None: ... if sys.platform == "win32": diff --git a/stubs/pysftp/pysftp/__init__.pyi b/stubs/pysftp/pysftp/__init__.pyi index 89d52ead34bd..fc532e43c7b5 100644 --- a/stubs/pysftp/pysftp/__init__.pyi +++ b/stubs/pysftp/pysftp/__init__.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from collections.abc import Callable, Sequence from contextlib import AbstractContextManager from stat import S_IMODE as S_IMODE @@ -123,7 +123,7 @@ class Connection: @property def remote_server_key(self) -> paramiko.PKey: ... def __del__(self) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, etype: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... diff --git a/stubs/python-crontab/cronlog.pyi b/stubs/python-crontab/cronlog.pyi index 3faad0b0f60c..87a07ee5655b 100644 --- a/stubs/python-crontab/cronlog.pyi +++ b/stubs/python-crontab/cronlog.pyi @@ -1,4 +1,5 @@ -from _typeshed import Self, StrOrBytesPath +from typing_extensions import Self +from _typeshed import StrOrBytesPath from codecs import StreamReaderWriter from collections.abc import Generator, Iterator from types import TracebackType @@ -12,7 +13,7 @@ class LogReader: read: int pipe: StreamReaderWriter | None def __init__(self, filename: StrOrBytesPath, mass: int = ...) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, error_type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... diff --git a/stubs/python-crontab/crontab.pyi b/stubs/python-crontab/crontab.pyi index 083a6fad2f33..337fa1bdf5a0 100644 --- a/stubs/python-crontab/crontab.pyi +++ b/stubs/python-crontab/crontab.pyi @@ -1,6 +1,7 @@ +from typing_extensions import Self import re import subprocess -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from builtins import range as _range from collections import OrderedDict from collections.abc import Callable, Generator, Iterable, Iterator @@ -46,7 +47,7 @@ class CronTab: def __init__( self, user: _User = ..., tab: str | None = ..., tabfile: str | None = ..., log: CronLog | str | None = ... ) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... @@ -115,7 +116,7 @@ class CronItem: def __hash__(self) -> int: ... def __eq__(self, other: object) -> bool: ... @classmethod - def from_line(cls: type[Self], line: str, user: str | None = ..., cron: Incomplete | None = ...) -> Self: ... + def from_line(cls, line: str, user: str | None = ..., cron: Incomplete | None = ...) -> Self: ... def delete(self) -> None: ... def set_command(self, cmd: str, parse_stdin: bool = ...) -> None: ... def set_comment(self, cmt: str, pre_comment: bool = ...) -> None: ... @@ -257,5 +258,5 @@ class OrderedVariableList(OrderedDict[Incomplete, Incomplete]): def __init__(self, *args: Any, **kw: Any) -> None: ... @property def previous(self) -> Incomplete: ... - def all(self: Self) -> Self: ... + def all(self) -> Self: ... def __getitem__(self, key: Incomplete) -> Incomplete: ... diff --git a/stubs/python-dateutil/dateutil/_common.pyi b/stubs/python-dateutil/dateutil/_common.pyi index 081bebecd309..cec4a11708ed 100644 --- a/stubs/python-dateutil/dateutil/_common.pyi +++ b/stubs/python-dateutil/dateutil/_common.pyi @@ -1,8 +1,8 @@ -from _typeshed import Self +from typing_extensions import Self class weekday: def __init__(self, weekday: int, n: int | None = ...) -> None: ... - def __call__(self: Self, n: int) -> Self: ... + def __call__(self, n: int) -> Self: ... def __eq__(self, other: object) -> bool: ... def __hash__(self) -> int: ... weekday: int diff --git a/stubs/python-dateutil/dateutil/relativedelta.pyi b/stubs/python-dateutil/dateutil/relativedelta.pyi index 20f7c68337b0..28be671433d0 100644 --- a/stubs/python-dateutil/dateutil/relativedelta.pyi +++ b/stubs/python-dateutil/dateutil/relativedelta.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from datetime import date, datetime, timedelta from typing import SupportsFloat, TypeVar, overload from typing_extensions import TypeAlias @@ -64,7 +64,7 @@ class relativedelta: def weeks(self) -> int: ... @weeks.setter def weeks(self, value: int) -> None: ... - def normalized(self: Self) -> Self: ... + def normalized(self) -> Self: ... # TODO: use Union when mypy will handle it properly in overloaded operator # methods (#2129, #1442, #1264 in mypy) @overload @@ -80,20 +80,20 @@ class relativedelta: @overload def __radd__(self, other: _DateT) -> _DateT: ... @overload - def __rsub__(self: Self, other: relativedelta) -> Self: ... + def __rsub__(self, other: relativedelta) -> Self: ... @overload - def __rsub__(self: Self, other: timedelta) -> Self: ... + def __rsub__(self, other: timedelta) -> Self: ... @overload def __rsub__(self, other: _DateT) -> _DateT: ... - def __sub__(self: Self, other: relativedelta) -> Self: ... - def __neg__(self: Self) -> Self: ... + def __sub__(self, other: relativedelta) -> Self: ... + def __neg__(self) -> Self: ... def __bool__(self) -> bool: ... def __nonzero__(self) -> bool: ... - def __mul__(self: Self, other: SupportsFloat) -> Self: ... - def __rmul__(self: Self, other: SupportsFloat) -> Self: ... + def __mul__(self, other: SupportsFloat) -> Self: ... + def __rmul__(self, other: SupportsFloat) -> Self: ... def __eq__(self, other: object) -> bool: ... def __ne__(self, other: object) -> bool: ... - def __div__(self: Self, other: SupportsFloat) -> Self: ... - def __truediv__(self: Self, other: SupportsFloat) -> Self: ... - def __abs__(self: Self) -> Self: ... + def __div__(self, other: SupportsFloat) -> Self: ... + def __truediv__(self, other: SupportsFloat) -> Self: ... + def __abs__(self) -> Self: ... def __hash__(self) -> int: ... diff --git a/stubs/python-jose/jose/backends/base.pyi b/stubs/python-jose/jose/backends/base.pyi index ea7f34f5bdeb..87bf85617ef3 100644 --- a/stubs/python-jose/jose/backends/base.pyi +++ b/stubs/python-jose/jose/backends/base.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from typing import Any class Key: @@ -8,7 +8,7 @@ class Key: def __init__(self, key, algorithm) -> None: ... def sign(self, msg: bytes) -> bytes: ... def verify(self, msg: bytes, sig: bytes) -> bool: ... - def public_key(self: Self) -> Self: ... + def public_key(self) -> Self: ... def to_pem(self) -> bytes: ... def to_dict(self) -> dict[str, Any]: ... def encrypt(self, plain_text: str | bytes, aad: bytes | None = ...) -> tuple[bytes, bytes, bytes | None]: ... diff --git a/stubs/python-jose/jose/backends/ecdsa_backend.pyi b/stubs/python-jose/jose/backends/ecdsa_backend.pyi index 9a78fb36b379..ec9489f19c63 100644 --- a/stubs/python-jose/jose/backends/ecdsa_backend.pyi +++ b/stubs/python-jose/jose/backends/ecdsa_backend.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from collections.abc import Callable from hashlib import _Hash from typing import Any @@ -20,6 +20,6 @@ class ECDSAECKey(Key): def sign(self, msg): ... def verify(self, msg, sig): ... def is_public(self) -> bool: ... - def public_key(self: Self) -> Self: ... + def public_key(self) -> Self: ... def to_pem(self): ... def to_dict(self) -> dict[str, Any]: ... diff --git a/stubs/python-jose/jose/backends/rsa_backend.pyi b/stubs/python-jose/jose/backends/rsa_backend.pyi index cb04422873e7..63fb20f686b4 100644 --- a/stubs/python-jose/jose/backends/rsa_backend.pyi +++ b/stubs/python-jose/jose/backends/rsa_backend.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from typing import Any from .base import Key @@ -20,7 +20,7 @@ class RSAKey(Key): def sign(self, msg: bytes) -> bytes: ... def verify(self, msg: bytes, sig: bytes) -> bool: ... def is_public(self) -> bool: ... - def public_key(self: Self) -> Self: ... + def public_key(self) -> Self: ... def to_pem(self, pem_format: str = ...) -> bytes: ... def to_dict(self) -> dict[str, Any]: ... def wrap_key(self, key_data: bytes) -> bytes: ... diff --git a/stubs/pywin32/_win32typing.pyi b/stubs/pywin32/_win32typing.pyi index e5b43e94b004..9f2c0748593b 100644 --- a/stubs/pywin32/_win32typing.pyi +++ b/stubs/pywin32/_win32typing.pyi @@ -1,5 +1,6 @@ # Not available at runtime. Contains type definitions that are otherwise not exposed and not part of a specific module. -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from collections.abc import Iterable from typing import overload from typing_extensions import Literal, final @@ -923,7 +924,7 @@ class PyHANDLE: def handle(self) -> int: ... def Close(self) -> None: ... def close(self) -> None: ... - def Detach(self: Self) -> Self: ... + def Detach(self) -> Self: ... @final class PyHDESK: diff --git a/stubs/redis/redis/asyncio/client.pyi b/stubs/redis/redis/asyncio/client.pyi index 6154780c3816..bf13b8896da1 100644 --- a/stubs/redis/redis/asyncio/client.pyi +++ b/stubs/redis/redis/asyncio/client.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from collections.abc import AsyncIterator, Awaitable, Callable, Iterable, Mapping, MutableMapping, Sequence from datetime import datetime, timedelta from typing import Any, ClassVar, Generic, NoReturn, Protocol, overload @@ -67,7 +68,7 @@ class Redis(AbstractRedis, RedisModuleCommands, AsyncCoreCommands[_StrType], Asy credential_provider: CredentialProvider | None = ..., ) -> None: ... def __await__(self): ... - async def initialize(self: Self) -> Self: ... + async def initialize(self) -> Self: ... def set_response_callback(self, command: str, callback: ResponseCallbackT): ... def load_external_module(self, funcname, func) -> None: ... def pipeline(self, transaction: bool = ..., shard_hint: str | None = ...) -> Pipeline[_StrType]: ... @@ -92,7 +93,7 @@ class Redis(AbstractRedis, RedisModuleCommands, AsyncCoreCommands[_StrType], Asy def pubsub(self, **kwargs) -> PubSub: ... def monitor(self) -> Monitor: ... def client(self) -> Redis[_StrType]: ... - async def __aenter__(self: Self) -> Self: ... + async def __aenter__(self) -> Self: ... async def __aexit__(self, exc_type, exc_value, traceback) -> None: ... def __del__(self, _warnings: Any = ...) -> None: ... async def close(self, close_connection_pool: bool | None = ...) -> None: ... @@ -116,7 +117,7 @@ class Monitor: connection: Any def __init__(self, connection_pool: ConnectionPool) -> None: ... async def connect(self) -> None: ... - async def __aenter__(self: Self) -> Self: ... + async def __aenter__(self) -> Self: ... async def __aexit__(self, *args) -> None: ... async def next_command(self) -> MonitorCommandInfo: ... def listen(self) -> AsyncIterator[MonitorCommandInfo]: ... @@ -142,7 +143,7 @@ class PubSub: ignore_subscribe_messages: bool = ..., encoder: Incomplete | None = ..., ) -> None: ... - async def __aenter__(self: Self) -> Self: ... + async def __aenter__(self) -> Self: ... async def __aexit__(self, exc_type, exc_value, traceback) -> None: ... def __del__(self) -> None: ... async def reset(self) -> None: ... @@ -191,7 +192,7 @@ class Pipeline(Redis[_StrType], Generic[_StrType]): transaction: bool, shard_hint: str | None, ) -> None: ... - async def __aenter__(self: Self) -> Self: ... + async def __aenter__(self) -> Self: ... async def __aexit__(self, exc_type, exc_value, traceback) -> None: ... def __await__(self): ... def __len__(self) -> int: ... diff --git a/stubs/redis/redis/asyncio/cluster.pyi b/stubs/redis/redis/asyncio/cluster.pyi index a68e81c6620a..2bbe22410975 100644 --- a/stubs/redis/redis/asyncio/cluster.pyi +++ b/stubs/redis/redis/asyncio/cluster.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from collections.abc import Awaitable, Callable, Mapping from typing import Any, Generic @@ -72,11 +73,11 @@ class RedisCluster(AbstractRedis, AbstractRedisCluster, Generic[_StrType]): # T ssl_check_hostname: bool = ..., ssl_keyfile: str | None = ..., ) -> None: ... - async def initialize(self: Self) -> Self: ... + async def initialize(self) -> Self: ... async def close(self) -> None: ... - async def __aenter__(self: Self) -> Self: ... + async def __aenter__(self) -> Self: ... async def __aexit__(self, exc_type: object, exc_value: object, traceback: object) -> None: ... - def __await__(self: Self) -> Awaitable[Self]: ... + def __await__(self) -> Awaitable[Self]: ... def __del__(self) -> None: ... async def on_connect(self, connection: Connection) -> None: ... def get_nodes(self) -> list[ClusterNode]: ... @@ -94,7 +95,7 @@ class RedisCluster(AbstractRedis, AbstractRedisCluster, Generic[_StrType]): # T async def execute_command(self, *args: EncodableT, **kwargs: Any) -> Any: ... def pipeline(self, transaction: Any | None = ..., shard_hint: Any | None = ...) -> ClusterPipeline[_StrType]: ... @classmethod - def from_url(cls: type[Self], url: str, **kwargs) -> Self: ... + def from_url(cls, url: str, **kwargs) -> Self: ... class ClusterNode: host: str @@ -143,17 +144,17 @@ class NodesManager: class ClusterPipeline(AbstractRedis, AbstractRedisCluster, Generic[_StrType]): # TODO: AsyncRedisClusterCommands def __init__(self, client: RedisCluster[_StrType]) -> None: ... - async def initialize(self: Self) -> Self: ... - async def __aenter__(self: Self) -> Self: ... + async def initialize(self) -> Self: ... + async def __aenter__(self) -> Self: ... async def __aexit__(self, exc_type: object, exc_value: object, traceback: object) -> None: ... - def __await__(self: Self) -> Awaitable[Self]: ... - def __enter__(self: Self) -> Self: ... + def __await__(self) -> Awaitable[Self]: ... + def __enter__(self) -> Self: ... def __exit__(self, exc_type: object, exc_value: object, traceback: object) -> None: ... def __bool__(self) -> bool: ... def __len__(self) -> int: ... - def execute_command(self: Self, *args: KeyT | EncodableT, **kwargs: Any) -> Self: ... + def execute_command(self, *args: KeyT | EncodableT, **kwargs: Any) -> Self: ... async def execute(self, raise_on_error: bool = ..., allow_redirections: bool = ...) -> list[Any]: ... - def mset_nonatomic(self: Self, mapping: Mapping[AnyKeyT, EncodableT]) -> Self: ... + def mset_nonatomic(self, mapping: Mapping[AnyKeyT, EncodableT]) -> Self: ... class PipelineCommand: args: Any diff --git a/stubs/redis/redis/asyncio/lock.pyi b/stubs/redis/redis/asyncio/lock.pyi index c9d3a93b665c..10ca9f210e3f 100644 --- a/stubs/redis/redis/asyncio/lock.pyi +++ b/stubs/redis/redis/asyncio/lock.pyi @@ -1,5 +1,5 @@ +from typing_extensions import Self import threading -from _typeshed import Self from collections.abc import Awaitable from types import SimpleNamespace, TracebackType from typing import Any, ClassVar @@ -33,7 +33,7 @@ class Lock: thread_local: bool = ..., ) -> None: ... def register_scripts(self) -> None: ... - async def __aenter__(self: Self) -> Self: ... + async def __aenter__(self) -> Self: ... async def __aexit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... diff --git a/stubs/redis/redis/client.pyi b/stubs/redis/redis/client.pyi index 329c6313fa01..612b9bb2a496 100644 --- a/stubs/redis/redis/client.pyi +++ b/stubs/redis/redis/client.pyi @@ -1,5 +1,6 @@ +from typing_extensions import Self import threading -from _typeshed import Incomplete, Self, SupportsItems +from _typeshed import Incomplete, SupportsItems from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence from datetime import datetime, timedelta from re import Pattern @@ -340,7 +341,7 @@ class PubSub: ignore_subscribe_messages: bool = ..., encoder: Incomplete | None = ..., ) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None ) -> None: ... @@ -724,7 +725,7 @@ class Monitor: command_re: Pattern[str] monitor_re: Pattern[str] def __init__(self, connection_pool) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, *args: object) -> None: ... def next_command(self) -> dict[str, Any]: ... def listen(self) -> Iterable[dict[str, Any]]: ... diff --git a/stubs/redis/redis/cluster.pyi b/stubs/redis/redis/cluster.pyi index 98a5cb6e9cd3..ccfbf80bc752 100644 --- a/stubs/redis/redis/cluster.pyi +++ b/stubs/redis/redis/cluster.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from collections.abc import Callable, Iterable, Sequence from threading import Lock from types import TracebackType @@ -71,14 +72,14 @@ class RedisCluster(AbstractRedisCluster, RedisClusterCommands[_StrType], Generic url: str | None = ..., **kwargs, ) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... def __del__(self) -> None: ... def disconnect_connection_pools(self) -> None: ... @classmethod - def from_url(cls: type[Self], url: str, **kwargs) -> Self: ... + def from_url(cls, url: str, **kwargs) -> Self: ... def on_connect(self, connection: Connection) -> None: ... def get_redis_connection(self, node: ClusterNode) -> Redis[Any]: ... def get_node( diff --git a/stubs/redis/redis/connection.pyi b/stubs/redis/redis/connection.pyi index 87853369e3aa..f8b431f05404 100644 --- a/stubs/redis/redis/connection.pyi +++ b/stubs/redis/redis/connection.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from collections.abc import Callable, Iterable, Mapping from queue import Queue from socket import socket @@ -199,7 +200,7 @@ class ConnectionPool: max_connections: int pid: int @classmethod - def from_url(cls: type[Self], url: str, *, db: int = ..., decode_components: bool = ..., **kwargs) -> Self: ... + def from_url(cls, url: str, *, db: int = ..., decode_components: bool = ..., **kwargs) -> Self: ... def __init__( self, connection_class: type[Connection] = ..., max_connections: int | None = ..., **connection_kwargs ) -> None: ... diff --git a/stubs/redis/redis/lock.pyi b/stubs/redis/redis/lock.pyi index 358f33596ea6..982f669e7c44 100644 --- a/stubs/redis/redis/lock.pyi +++ b/stubs/redis/redis/lock.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from types import TracebackType from typing import Any, ClassVar, Protocol @@ -26,7 +27,7 @@ class Lock: thread_local: bool = ..., ) -> None: ... def register_scripts(self) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None ) -> bool | None: ... diff --git a/stubs/regex/regex/_regex.pyi b/stubs/regex/regex/_regex.pyi index 60cd19e6c402..d55844cf104d 100644 --- a/stubs/regex/regex/_regex.pyi +++ b/stubs/regex/regex/_regex.pyi @@ -3,7 +3,7 @@ # For example: `Pattern` and `Match` are not exported # and are redefined in `regex.regex module. -from _typeshed import Self +from typing_extensions import Self from typing import Any, AnyStr, Generic from typing_extensions import final @@ -13,7 +13,7 @@ from .regex import Match, Pattern class Splitter(Generic[AnyStr]): @property def pattern(self) -> Pattern[AnyStr]: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> AnyStr | Any: ... def split(self) -> AnyStr | Any: ... @@ -21,7 +21,7 @@ class Splitter(Generic[AnyStr]): class Scanner(Generic[AnyStr]): @property def pattern(self) -> Pattern[AnyStr]: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> Match[AnyStr]: ... def match(self) -> Match[AnyStr] | None: ... def search(self) -> Match[AnyStr] | None: ... diff --git a/stubs/regex/regex/regex.pyi b/stubs/regex/regex/regex.pyi index b354eb09a354..34b8b925ef99 100644 --- a/stubs/regex/regex/regex.pyi +++ b/stubs/regex/regex/regex.pyi @@ -1,5 +1,6 @@ +from typing_extensions import Self import sys -from _typeshed import ReadableBuffer, Self +from _typeshed import ReadableBuffer from collections.abc import Callable, Mapping from typing import Any, AnyStr, Generic, TypeVar, overload from typing_extensions import Literal, final @@ -565,8 +566,8 @@ class Pattern(Generic[AnyStr]): concurrent: bool | None = ..., timeout: float | None = ..., ) -> _regex.Scanner[bytes]: ... - def __copy__(self: Self) -> Self: ... - def __deepcopy__(self: Self) -> Self: ... + def __copy__(self) -> Self: ... + def __deepcopy__(self) -> Self: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, item: Any) -> GenericAlias: ... @@ -644,7 +645,7 @@ class Match(Generic[AnyStr]): def __getitem__(self, __key: Literal[0]) -> AnyStr: ... @overload def __getitem__(self, __key: int | str) -> AnyStr | Any: ... - def __copy__(self: Self) -> Self: ... - def __deepcopy__(self: Self) -> Self: ... + def __copy__(self) -> Self: ... + def __deepcopy__(self) -> Self: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, item: Any) -> GenericAlias: ... diff --git a/stubs/requests/requests/models.pyi b/stubs/requests/requests/models.pyi index e5836186999c..ddfa506c6bcd 100644 --- a/stubs/requests/requests/models.pyi +++ b/stubs/requests/requests/models.pyi @@ -1,5 +1,5 @@ +from typing_extensions import Self import datetime -from _typeshed import Self from collections.abc import Callable, Iterator from json import JSONDecoder from typing import Any @@ -106,7 +106,7 @@ class Response: def __bool__(self) -> bool: ... def __nonzero__(self) -> bool: ... def __iter__(self) -> Iterator[bytes]: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, *args: object) -> None: ... @property def next(self) -> PreparedRequest | None: ... diff --git a/stubs/requests/requests/sessions.pyi b/stubs/requests/requests/sessions.pyi index 95cb7381e986..25b35ad399ca 100644 --- a/stubs/requests/requests/sessions.pyi +++ b/stubs/requests/requests/sessions.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self, SupportsItems, SupportsRead +from typing_extensions import Self +from _typeshed import Incomplete, SupportsItems, SupportsRead from collections.abc import Callable, Iterable, Mapping, MutableMapping from typing import Any from typing_extensions import TypeAlias, TypedDict @@ -133,7 +134,7 @@ class Session(SessionRedirectMixin): adapters: MutableMapping[Any, Any] redirect_cache: RecentlyUsedContainer[Any, Any] def __init__(self) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, *args) -> None: ... def prepare_request(self, request: Request) -> PreparedRequest: ... def request( diff --git a/stubs/setuptools/pkg_resources/__init__.pyi b/stubs/setuptools/pkg_resources/__init__.pyi index efa7329beb0c..eb9601b7567e 100644 --- a/stubs/setuptools/pkg_resources/__init__.pyi +++ b/stubs/setuptools/pkg_resources/__init__.pyi @@ -1,7 +1,8 @@ +from typing_extensions import Self import importlib.abc import types import zipimport -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from abc import ABCMeta from collections.abc import Callable, Generator, Iterable, Sequence from typing import IO, Any, TypeVar, overload @@ -55,7 +56,7 @@ class Environment: def remove(self, dist: Distribution) -> None: ... def can_add(self, dist: Distribution) -> bool: ... def __add__(self, other: Distribution | Environment) -> Environment: ... - def __iadd__(self: Self, other: Distribution | Environment) -> Self: ... + def __iadd__(self, other: Distribution | Environment) -> Self: ... @overload def best_match(self, req: Requirement, working_set: WorkingSet, *, replace_conflicting: bool = ...) -> Distribution: ... @overload diff --git a/stubs/setuptools/setuptools/_distutils/version.pyi b/stubs/setuptools/setuptools/_distutils/version.pyi index 7e807d7d0711..23c6bbbacf0a 100644 --- a/stubs/setuptools/setuptools/_distutils/version.pyi +++ b/stubs/setuptools/setuptools/_distutils/version.pyi @@ -1,26 +1,26 @@ -from _typeshed import Self +from typing_extensions import Self from re import Pattern class Version: def __init__(self, vstring: str | None = ...) -> None: ... def __eq__(self, other: object) -> bool: ... - def __lt__(self: Self, other: Self | str) -> bool: ... - def __le__(self: Self, other: Self | str) -> bool: ... - def __gt__(self: Self, other: Self | str) -> bool: ... - def __ge__(self: Self, other: Self | str) -> bool: ... + def __lt__(self, other: Self | str) -> bool: ... + def __le__(self, other: Self | str) -> bool: ... + def __gt__(self, other: Self | str) -> bool: ... + def __ge__(self, other: Self | str) -> bool: ... class StrictVersion(Version): version_re: Pattern[str] version: tuple[int, int, int] prerelease: tuple[str, int] | None def __init__(self, vstring: str | None = ...) -> None: ... - def parse(self: Self, vstring: str) -> Self: ... - def _cmp(self: Self, other: Self | str) -> bool: ... + def parse(self, vstring: str) -> Self: ... + def _cmp(self, other: Self | str) -> bool: ... class LooseVersion(Version): component_re: Pattern[str] vstring: str version: tuple[str | int, ...] def __init__(self, vstring: str | None = ...) -> None: ... - def parse(self: Self, vstring: str) -> Self: ... - def _cmp(self: Self, other: Self | str) -> bool: ... + def parse(self, vstring: str) -> Self: ... + def _cmp(self, other: Self | str) -> bool: ... diff --git a/stubs/setuptools/setuptools/command/test.pyi b/stubs/setuptools/setuptools/command/test.pyi index e61fbca6328c..bfaa842640ec 100644 --- a/stubs/setuptools/setuptools/command/test.pyi +++ b/stubs/setuptools/setuptools/command/test.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from collections.abc import Callable from types import ModuleType from typing import Any, Generic, TypeVar, overload @@ -16,7 +17,7 @@ class NonDataProperty(Generic[_T]): fget: Callable[..., _T] def __init__(self, fget: Callable[..., _T]) -> None: ... @overload - def __get__(self: Self, obj: None, objtype: object = ...) -> Self: ... + def __get__(self, obj: None, objtype: object = ...) -> Self: ... @overload def __get__(self, obj: Any, objtype: object = ...) -> _T: ... diff --git a/stubs/slumber/slumber/__init__.pyi b/stubs/slumber/slumber/__init__.pyi index b03c170ca4ca..3b72a5a4b28e 100644 --- a/stubs/slumber/slumber/__init__.pyi +++ b/stubs/slumber/slumber/__init__.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from typing import Any from requests import Response, Session @@ -14,8 +14,8 @@ class ResourceAttributesMixin: class Resource(ResourceAttributesMixin): def __init__(self, *args: Any, **kwargs: Any) -> None: ... - def __call__(self: Self, id: str | None = ..., format: str | None = ..., url_override: str | None = ...) -> Self: ... - def as_raw(self: Self) -> Self: ... + def __call__(self, id: str | None = ..., format: str | None = ..., url_override: str | None = ...) -> Self: ... + def as_raw(self) -> Self: ... def get(self, **kwargs: Any) -> Response: ... def options(self, **kwargs: Any) -> Response: ... def head(self, **kwargs: Any) -> Response: ... diff --git a/stubs/stripe/stripe/api_resources/abstract/api_resource.pyi b/stubs/stripe/stripe/api_resources/abstract/api_resource.pyi index 88918e8c030b..9eb351bcf5ed 100644 --- a/stubs/stripe/stripe/api_resources/abstract/api_resource.pyi +++ b/stubs/stripe/stripe/api_resources/abstract/api_resource.pyi @@ -1,12 +1,13 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from stripe import api_requestor as api_requestor, error as error from stripe.stripe_object import StripeObject as StripeObject class APIResource(StripeObject): @classmethod - def retrieve(cls: type[Self], id, api_key: Incomplete | None = ..., **params) -> Self: ... - def refresh(self: Self) -> Self: ... + def retrieve(cls, id, api_key: Incomplete | None = ..., **params) -> Self: ... + def refresh(self) -> Self: ... @classmethod def class_url(cls) -> str: ... def instance_url(self) -> str: ... diff --git a/stubs/stripe/stripe/api_resources/abstract/createable_api_resource.pyi b/stubs/stripe/stripe/api_resources/abstract/createable_api_resource.pyi index 41e18a574765..dd3e690ae269 100644 --- a/stubs/stripe/stripe/api_resources/abstract/createable_api_resource.pyi +++ b/stubs/stripe/stripe/api_resources/abstract/createable_api_resource.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from stripe import api_requestor as api_requestor from stripe.api_resources.abstract.api_resource import APIResource as APIResource @@ -6,7 +7,7 @@ from stripe.api_resources.abstract.api_resource import APIResource as APIResourc class CreateableAPIResource(APIResource): @classmethod def create( - cls: type[Self], + cls, api_key: Incomplete | None = ..., idempotency_key: str | None = ..., stripe_version: Incomplete | None = ..., diff --git a/stubs/stripe/stripe/api_resources/abstract/deletable_api_resource.pyi b/stubs/stripe/stripe/api_resources/abstract/deletable_api_resource.pyi index 154355211a46..484a37382105 100644 --- a/stubs/stripe/stripe/api_resources/abstract/deletable_api_resource.pyi +++ b/stubs/stripe/stripe/api_resources/abstract/deletable_api_resource.pyi @@ -1,7 +1,7 @@ -from _typeshed import Self +from typing_extensions import Self from stripe.api_resources.abstract.api_resource import APIResource as APIResource class DeletableAPIResource(APIResource): @classmethod - def delete(cls: type[Self], sid: str = ..., **params) -> Self: ... + def delete(cls, sid: str = ..., **params) -> Self: ... diff --git a/stubs/stripe/stripe/api_resources/abstract/searchable_api_resource.pyi b/stubs/stripe/stripe/api_resources/abstract/searchable_api_resource.pyi index e8cf8ce998dd..beec4b4f51c3 100644 --- a/stubs/stripe/stripe/api_resources/abstract/searchable_api_resource.pyi +++ b/stubs/stripe/stripe/api_resources/abstract/searchable_api_resource.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from collections.abc import Iterator from stripe.api_resources.abstract.api_resource import APIResource as APIResource @@ -6,6 +6,6 @@ from stripe.api_resources.search_result_object import SearchResultObject class SearchableAPIResource(APIResource): @classmethod - def search(cls: type[Self], *args: str | None, **kwargs) -> SearchResultObject[Self]: ... + def search(cls, *args: str | None, **kwargs) -> SearchResultObject[Self]: ... @classmethod - def search_auto_paging_iter(cls: type[Self], *args: str | None, **kwargs) -> Iterator[Self]: ... + def search_auto_paging_iter(cls, *args: str | None, **kwargs) -> Iterator[Self]: ... diff --git a/stubs/stripe/stripe/api_resources/abstract/updateable_api_resource.pyi b/stubs/stripe/stripe/api_resources/abstract/updateable_api_resource.pyi index b7ee885f22f3..fb88d5affe45 100644 --- a/stubs/stripe/stripe/api_resources/abstract/updateable_api_resource.pyi +++ b/stubs/stripe/stripe/api_resources/abstract/updateable_api_resource.pyi @@ -1,8 +1,8 @@ -from _typeshed import Self +from typing_extensions import Self from stripe.api_resources.abstract.api_resource import APIResource as APIResource class UpdateableAPIResource(APIResource): @classmethod - def modify(cls: type[Self], sid: str, **params) -> Self: ... - def save(self: Self, idempotency_key: str | None = ...) -> Self: ... + def modify(cls, sid: str, **params) -> Self: ... + def save(self, idempotency_key: str | None = ...) -> Self: ... diff --git a/stubs/stripe/stripe/api_resources/application_fee_refund.pyi b/stubs/stripe/stripe/api_resources/application_fee_refund.pyi index ffac515a5292..60537e6622ef 100644 --- a/stubs/stripe/stripe/api_resources/application_fee_refund.pyi +++ b/stubs/stripe/stripe/api_resources/application_fee_refund.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from typing import NoReturn from stripe.api_resources import ApplicationFee as ApplicationFee @@ -7,7 +8,7 @@ from stripe.api_resources.abstract import UpdateableAPIResource as UpdateableAPI class ApplicationFeeRefund(UpdateableAPIResource): OBJECT_NAME: str @classmethod - def modify(cls: type[Self], fee, sid: str, **params) -> Self: ... # type: ignore[override] + def modify(cls, fee, sid: str, **params) -> Self: ... # type: ignore[override] def instance_url(self) -> str: ... @classmethod def retrieve(cls, id, api_key: Incomplete | None = ..., **params) -> NoReturn: ... diff --git a/stubs/stripe/stripe/api_resources/invoice.pyi b/stubs/stripe/stripe/api_resources/invoice.pyi index e399ed65bbc4..5ad93c27dda5 100644 --- a/stubs/stripe/stripe/api_resources/invoice.pyi +++ b/stubs/stripe/stripe/api_resources/invoice.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from stripe import api_requestor as api_requestor from stripe.api_resources.abstract import ( @@ -12,11 +13,11 @@ from stripe.api_resources.abstract import ( class Invoice(CreateableAPIResource, DeletableAPIResource, ListableAPIResource, SearchableAPIResource, UpdateableAPIResource): OBJECT_NAME: str - def finalize_invoice(self: Self, idempotency_key: str | None = ..., **params) -> Self: ... - def mark_uncollectible(self: Self, idempotency_key: str | None = ..., **params) -> Self: ... - def pay(self: Self, idempotency_key: str | None = ..., **params) -> Self: ... - def send_invoice(self: Self, idempotency_key: str | None = ..., **params) -> Self: ... - def void_invoice(self: Self, idempotency_key: str | None = ..., **params) -> Self: ... + def finalize_invoice(self, idempotency_key: str | None = ..., **params) -> Self: ... + def mark_uncollectible(self, idempotency_key: str | None = ..., **params) -> Self: ... + def pay(self, idempotency_key: str | None = ..., **params) -> Self: ... + def send_invoice(self, idempotency_key: str | None = ..., **params) -> Self: ... + def void_invoice(self, idempotency_key: str | None = ..., **params) -> Self: ... @classmethod def upcoming( cls, diff --git a/stubs/stripe/stripe/api_resources/payment_method.pyi b/stubs/stripe/stripe/api_resources/payment_method.pyi index 4a8f17435945..5db83f3398ef 100644 --- a/stubs/stripe/stripe/api_resources/payment_method.pyi +++ b/stubs/stripe/stripe/api_resources/payment_method.pyi @@ -1,5 +1,5 @@ -from _typeshed import Self +from typing_extensions import Self from stripe.api_resources.abstract import ( CreateableAPIResource as CreateableAPIResource, ListableAPIResource as ListableAPIResource, @@ -9,5 +9,5 @@ from stripe.api_resources.abstract import ( class PaymentMethod(CreateableAPIResource, ListableAPIResource, UpdateableAPIResource): OBJECT_NAME: str - def attach(self: Self, idempotency_key: str | None = ..., **params) -> Self: ... - def detach(self: Self, idempotency_key: str | None = ..., **params) -> Self: ... + def attach(self, idempotency_key: str | None = ..., **params) -> Self: ... + def detach(self, idempotency_key: str | None = ..., **params) -> Self: ... diff --git a/stubs/stripe/stripe/api_resources/search_result_object.pyi b/stubs/stripe/stripe/api_resources/search_result_object.pyi index f6b858c27def..643333f01e94 100644 --- a/stubs/stripe/stripe/api_resources/search_result_object.pyi +++ b/stubs/stripe/stripe/api_resources/search_result_object.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from collections.abc import Iterator from typing import Any, ClassVar, Generic, TypeVar from typing_extensions import Literal @@ -16,7 +16,7 @@ class SearchResultObject(StripeObject, Generic[_T]): total_count: int def search( - self: Self, api_key: str | None = ..., stripe_version: str | None = ..., stripe_account: str | None = ..., **params + self, api_key: str | None = ..., stripe_version: str | None = ..., stripe_account: str | None = ..., **params ) -> Self: ... def __getitem__(self, k: str) -> Any: ... def __iter__(self) -> Iterator[_T]: ... @@ -24,10 +24,10 @@ class SearchResultObject(StripeObject, Generic[_T]): def auto_paging_iter(self) -> Iterator[_T]: ... @classmethod def empty_search_result( - cls: type[Self], api_key: str | None = ..., stripe_version: str | None = ..., stripe_account: str | None = ... + cls, api_key: str | None = ..., stripe_version: str | None = ..., stripe_account: str | None = ... ) -> Self: ... @property def is_empty(self) -> bool: ... def next_search_result_page( - self: Self, api_key: str | None = ..., stripe_version: str | None = ..., stripe_account: str | None = ..., **params + self, api_key: str | None = ..., stripe_version: str | None = ..., stripe_account: str | None = ..., **params ) -> Self: ... diff --git a/stubs/stripe/stripe/api_resources/test_helpers/test_clock.pyi b/stubs/stripe/stripe/api_resources/test_helpers/test_clock.pyi index 86495c375ab0..eaeab8110f85 100644 --- a/stubs/stripe/stripe/api_resources/test_helpers/test_clock.pyi +++ b/stubs/stripe/stripe/api_resources/test_helpers/test_clock.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from typing import Any from typing_extensions import Literal @@ -8,4 +8,4 @@ class TestClock(CreateableAPIResource, DeletableAPIResource, ListableAPIResource OBJECT_NAME: Literal["test_helpers.test_clock"] @classmethod - def advance(cls: type[Self], idempotency_key: str | None = ..., **params: Any) -> Self: ... + def advance(cls, idempotency_key: str | None = ..., **params: Any) -> Self: ... diff --git a/stubs/stripe/stripe/stripe_object.pyi b/stubs/stripe/stripe/stripe_object.pyi index 5c1adfc987aa..d172859e2b8b 100644 --- a/stubs/stripe/stripe/stripe_object.pyi +++ b/stubs/stripe/stripe/stripe_object.pyi @@ -1,5 +1,6 @@ +from typing_extensions import Self import json -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from typing import Any from stripe import api_requestor as api_requestor @@ -29,7 +30,7 @@ class StripeObject(dict[Any, Any]): def __reduce__(self): ... @classmethod def construct_from( - cls: type[Self], + cls, values: Any, key: str | None, stripe_version: Incomplete | None = ..., diff --git a/stubs/tensorflow/tensorflow/__init__.pyi b/stubs/tensorflow/tensorflow/__init__.pyi index 62cab55b71a2..e3709bc20f1f 100644 --- a/stubs/tensorflow/tensorflow/__init__.pyi +++ b/stubs/tensorflow/tensorflow/__init__.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self, Unused +from typing_extensions import Self +from _typeshed import Incomplete, Unused from abc import ABCMeta from builtins import bool as _bool from collections.abc import Callable, Iterable, Iterator, Sequence @@ -222,7 +223,7 @@ class Graph: def add_to_collection(self, name: str, value: object) -> None: ... def add_to_collections(self, names: Iterable[str] | str, value: object) -> None: ... @contextmanager - def as_default(self: Self) -> Iterator[Self]: ... + def as_default(self) -> Iterator[Self]: ... def finalize(self) -> None: ... def get_tensor_by_name(self, name: str) -> Tensor: ... def get_operation_by_name(self, name: str) -> Operation: ... diff --git a/stubs/toml/toml/tz.pyi b/stubs/toml/toml/tz.pyi index 398a3e5cd777..c4c96adcbe02 100644 --- a/stubs/toml/toml/tz.pyi +++ b/stubs/toml/toml/tz.pyi @@ -1,10 +1,10 @@ -from _typeshed import Self +from typing_extensions import Self from datetime import datetime, timedelta, tzinfo from typing import Any class TomlTz(tzinfo): def __init__(self, toml_offset: str) -> None: ... - def __deepcopy__(self: Self, memo: Any) -> Self: ... + def __deepcopy__(self, memo: Any) -> Self: ... def tzname(self, dt: datetime | None) -> str: ... def utcoffset(self, dt: datetime | None) -> timedelta: ... def dst(self, dt: datetime | None) -> timedelta: ... diff --git a/stubs/tqdm/tqdm/asyncio.pyi b/stubs/tqdm/tqdm/asyncio.pyi index f0f3a07531a8..7d53ddff7081 100644 --- a/stubs/tqdm/tqdm/asyncio.pyi +++ b/stubs/tqdm/tqdm/asyncio.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self, SupportsWrite +from typing_extensions import Self +from _typeshed import Incomplete, SupportsWrite from collections.abc import Awaitable, Callable, Generator, Iterable, Iterator, Mapping from typing import Generic, NoReturn, TypeVar, overload @@ -13,7 +14,7 @@ class tqdm_asyncio(Generic[_T], std_tqdm[_T]): iterable_next: Callable[[], _T | Awaitable[_T]] iterable_iterator: Iterator[_T] - def __aiter__(self: Self) -> Self: ... + def __aiter__(self) -> Self: ... async def __anext__(self) -> Awaitable[_T]: ... def send(self, *args, **kwargs): ... @classmethod diff --git a/stubs/tqdm/tqdm/dask.pyi b/stubs/tqdm/tqdm/dask.pyi index dbd7e6b246b7..73293250b31b 100644 --- a/stubs/tqdm/tqdm/dask.pyi +++ b/stubs/tqdm/tqdm/dask.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete, Self +from typing_extensions import Self +from _typeshed import Incomplete from collections.abc import Callable from typing import ClassVar @@ -15,7 +16,7 @@ class _Callback: posttask: Incomplete | None, finish: Incomplete | None, ) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, *args) -> None: ... def register(self) -> None: ... def unregister(self) -> None: ... diff --git a/stubs/tqdm/tqdm/std.pyi b/stubs/tqdm/tqdm/std.pyi index bd1526e200aa..42ecf643d588 100644 --- a/stubs/tqdm/tqdm/std.pyi +++ b/stubs/tqdm/tqdm/std.pyi @@ -1,5 +1,6 @@ +from typing_extensions import Self import contextlib -from _typeshed import Incomplete, Self, SupportsWrite +from _typeshed import Incomplete, SupportsWrite from collections.abc import Callable, Iterable, Iterator, Mapping, MutableMapping from typing import Any, ClassVar, Generic, NoReturn, TypeVar, overload from typing_extensions import Literal @@ -121,7 +122,7 @@ class tqdm(Generic[_T], Iterable[_T], Comparable): gui: bool = ..., **kwargs, ) -> None: ... - def __new__(cls: type[Self], *_, **__) -> Self: ... + def __new__(cls, *_, **__) -> Self: ... @classmethod def write(cls, s: str, file: SupportsWrite[str] | None = ..., end: str = ..., nolock: bool = ...) -> None: ... @classmethod @@ -199,7 +200,7 @@ class tqdm(Generic[_T], Iterable[_T], Comparable): def __len__(self) -> int: ... def __reversed__(self) -> Iterator[_T]: ... def __contains__(self, item: object) -> bool: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, exc_type: object, exc_value: object, traceback: object) -> None: ... def __del__(self) -> None: ... def __hash__(self) -> int: ... diff --git a/stubs/untangle/untangle.pyi b/stubs/untangle/untangle.pyi index b2d7c960f269..ef2121fecf5a 100644 --- a/stubs/untangle/untangle.pyi +++ b/stubs/untangle/untangle.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from collections.abc import Iterator, Mapping from typing import Any from xml.sax import handler @@ -17,7 +17,7 @@ class Element: def __getitem__(self, key: str) -> Any | None: ... def __getattr__(self, key: str) -> Element: ... def __hasattribute__(self, name: str) -> bool: ... - def __iter__(self: Self) -> Iterator[Self]: ... + def __iter__(self) -> Iterator[Self]: ... def __bool__(self) -> bool: ... __nonzero__ = __bool__ def __eq__(self, val: object) -> bool: ... diff --git a/stubs/urllib3/urllib3/connectionpool.pyi b/stubs/urllib3/urllib3/connectionpool.pyi index b0987dbe6dcc..6f673eb40eb5 100644 --- a/stubs/urllib3/urllib3/connectionpool.pyi +++ b/stubs/urllib3/urllib3/connectionpool.pyi @@ -1,5 +1,5 @@ +from typing_extensions import Self import queue -from _typeshed import Self from collections.abc import Mapping from logging import Logger from types import TracebackType @@ -47,7 +47,7 @@ class ConnectionPool: host: str port: int | None def __init__(self, host: str, port: int | None = ...) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> Literal[False]: ... diff --git a/stubs/urllib3/urllib3/response.pyi b/stubs/urllib3/urllib3/response.pyi index ac72ced0aac7..bc99aeb6b181 100644 --- a/stubs/urllib3/urllib3/response.pyi +++ b/stubs/urllib3/urllib3/response.pyi @@ -1,5 +1,5 @@ +from typing_extensions import Self import io -from _typeshed import Self from collections.abc import Iterable, Iterator, Mapping from http.client import HTTPMessage as _HttplibHTTPMessage, HTTPResponse as _HttplibHTTPResponse from typing import IO, Any @@ -83,7 +83,7 @@ class HTTPResponse(io.IOBase): def read(self, amt: int | None = ..., decode_content: bool | None = ..., cache_content: bool = ...) -> bytes: ... def stream(self, amt: int | None = ..., decode_content: bool | None = ...) -> Iterator[bytes]: ... @classmethod - def from_httplib(cls: type[Self], r: _HttplibHTTPResponse, **response_kw: Any) -> Self: ... + def from_httplib(cls, r: _HttplibHTTPResponse, **response_kw: Any) -> Self: ... def getheaders(self) -> HTTPHeaderDict: ... def getheader(self, name, default=...) -> str | None: ... def info(self) -> HTTPHeaderDict: ... diff --git a/stubs/urllib3/urllib3/util/retry.pyi b/stubs/urllib3/urllib3/util/retry.pyi index bd1a5ff44cf3..e29765b0c51c 100644 --- a/stubs/urllib3/urllib3/util/retry.pyi +++ b/stubs/urllib3/urllib3/util/retry.pyi @@ -1,5 +1,5 @@ +from typing_extensions import Self import logging -from _typeshed import Self from collections.abc import Collection from types import TracebackType from typing import Any, ClassVar, NamedTuple @@ -62,7 +62,7 @@ class Retry: remove_headers_on_redirect: Collection[str] = ..., method_whitelist: Collection[str] | None = ..., ) -> None: ... - def new(self: Self, **kw: Any) -> Self: ... + def new(self, **kw: Any) -> Self: ... @classmethod def from_int( cls, retries: Retry | bool | int | None, redirect: bool | int | None = ..., default: Retry | bool | int | None = ... From 4ded3e568c1e557af3fbb69756191d0e1b11c33f Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Thu, 9 Feb 2023 16:42:26 +0000 Subject: [PATCH 2/7] Fix syntax error in `ldap3` --- stubs/ldap3/ldap3/core/connection.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/ldap3/ldap3/core/connection.pyi b/stubs/ldap3/ldap3/core/connection.pyi index 23f0b226a7d6..fc28e6c17c46 100644 --- a/stubs/ldap3/ldap3/core/connection.pyi +++ b/stubs/ldap3/ldap3/core/connection.pyi @@ -1,6 +1,6 @@ from typing_extensions import Self from _collections_abc import Generator, dict_keys -from _typeshed import Incomplete, ReadableBuffer, +from _typeshed import Incomplete, ReadableBuffer from types import TracebackType from typing_extensions import Literal, TypeAlias From dffde0418399117fbc964e5d6714aef6e4b4e6b6 Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Thu, 9 Feb 2023 16:43:18 +0000 Subject: [PATCH 3/7] isort and black --- stubs/DateTimeRange/datetimerange/__init__.pyi | 2 +- stubs/ExifRead/exifread/utils.pyi | 2 +- stubs/JACK-Client/jack/__init__.pyi | 3 +-- stubs/Markdown/markdown/core.pyi | 3 +-- stubs/Pillow/PIL/Image.pyi | 3 +-- stubs/Pillow/PIL/ImageFile.pyi | 2 +- stubs/Pillow/PIL/ImageFilter.pyi | 3 +-- stubs/PyMySQL/pymysql/connections.pyi | 2 +- stubs/PyMySQL/pymysql/cursors.pyi | 2 +- stubs/Pygments/pygments/token.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/engine/base.pyi | 3 +-- stubs/SQLAlchemy/sqlalchemy/engine/mock.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/engine/result.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/engine/url.pyi | 3 +-- stubs/SQLAlchemy/sqlalchemy/engine/util.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/log.pyi | 3 +-- stubs/SQLAlchemy/sqlalchemy/orm/query.pyi | 10 ++-------- stubs/SQLAlchemy/sqlalchemy/orm/session.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/sql/base.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi | 3 +-- stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi | 13 +++---------- stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi | 2 +- stubs/aiofiles/aiofiles/base.pyi | 2 +- .../aws_xray_sdk/core/models/trace_header.pyi | 2 +- stubs/beautifulsoup4/bs4/__init__.pyi | 2 +- stubs/beautifulsoup4/bs4/element.pyi | 3 +-- stubs/caldav/caldav/davclient.pyi | 3 +-- stubs/caldav/caldav/elements/base.pyi | 3 +-- stubs/caldav/caldav/objects.pyi | 3 +-- stubs/click-spinner/click_spinner/__init__.pyi | 3 +-- stubs/croniter/croniter/croniter.pyi | 3 +-- stubs/dateparser/dateparser/conf.pyi | 2 +- stubs/docutils/docutils/__init__.pyi | 10 ++-------- stubs/docutils/docutils/nodes.pyi | 3 +-- stubs/entrypoints/entrypoints.pyi | 2 +- stubs/fpdf2/fpdf/drawing.pyi | 3 +-- stubs/fpdf2/fpdf/enums.pyi | 3 +-- .../google/cloud/ndb/global_cache.pyi | 6 ++---- stubs/google-cloud-ndb/google/cloud/ndb/model.pyi | 3 +-- stubs/httplib2/httplib2/__init__.pyi | 2 +- stubs/ibm-db/ibm_db.pyi | 3 +-- .../influxdb_client/client/flux_csv_parser.pyi | 2 +- .../influxdb_client/client/influxdb_client.pyi | 2 +- .../client/influxdb_client_async.pyi | 2 +- .../influxdb_client/client/write/point.pyi | 3 +-- stubs/invoke/invoke/tasks.pyi | 3 +-- stubs/jsonschema/jsonschema/exceptions.pyi | 3 +-- stubs/ldap3/ldap3/core/connection.pyi | 5 ++--- stubs/ldap3/ldap3/core/exceptions.pyi | 2 +- stubs/mock/mock/mock.pyi | 3 +-- stubs/mypy-extensions/mypy_extensions.pyi | 3 +-- stubs/mysqlclient/MySQLdb/connections.pyi | 2 +- stubs/netaddr/netaddr/eui/__init__.pyi | 3 +-- stubs/netaddr/netaddr/ip/__init__.pyi | 3 +-- stubs/netaddr/netaddr/ip/sets.pyi | 3 +-- .../opentracing/opentracing/mocktracer/context.pyi | 2 +- stubs/opentracing/opentracing/mocktracer/span.pyi | 2 +- stubs/opentracing/opentracing/scope.pyi | 2 +- stubs/opentracing/opentracing/span.pyi | 2 +- stubs/paramiko/paramiko/_winapi.pyi | 2 +- stubs/paramiko/paramiko/config.pyi | 2 +- stubs/paramiko/paramiko/hostkeys.pyi | 2 +- stubs/paramiko/paramiko/pkey.pyi | 2 +- stubs/paramiko/paramiko/sftp_attr.pyi | 2 +- stubs/paramiko/paramiko/sftp_client.pyi | 7 ++----- stubs/paramiko/paramiko/util.pyi | 2 +- stubs/parsimonious/parsimonious/expressions.pyi | 3 +-- stubs/passlib/passlib/context.pyi | 2 +- stubs/passlib/passlib/handlers/pbkdf2.pyi | 2 +- stubs/passlib/passlib/handlers/phpass.pyi | 2 +- stubs/passlib/passlib/handlers/sha1_crypt.pyi | 2 +- stubs/passlib/passlib/handlers/sha2_crypt.pyi | 2 +- stubs/passlib/passlib/handlers/sun_md5_crypt.pyi | 2 +- stubs/passlib/passlib/ifc.pyi | 3 +-- stubs/passlib/passlib/utils/handlers.pyi | 2 +- stubs/peewee/peewee.pyi | 2 +- stubs/pika/pika/adapters/asyncio_connection.pyi | 2 +- stubs/pika/pika/adapters/base_connection.pyi | 2 +- stubs/pika/pika/adapters/blocking_connection.pyi | 2 +- stubs/pika/pika/channel.pyi | 3 +-- stubs/pika/pika/connection.pyi | 7 ++----- stubs/pika/pika/spec.pyi | 3 +-- stubs/protobuf/google/protobuf/message.pyi | 2 +- stubs/psutil/psutil/__init__.pyi | 3 +-- stubs/psycopg2/psycopg2/_psycopg.pyi | 3 +-- stubs/pyRFC3339/pyrfc3339/utils.pyi | 2 +- stubs/pyasn1/pyasn1/type/univ.pyi | 3 +-- stubs/pycurl/pycurl.pyi | 3 +-- stubs/pyinstaller/PyInstaller/isolated/_parent.pyi | 3 +-- stubs/pynput/pynput/_util.pyi | 3 +-- stubs/pynput/pynput/keyboard/_base.pyi | 2 +- stubs/pynput/pynput/mouse/_base.pyi | 2 +- stubs/pyserial/serial/threaded/__init__.pyi | 2 +- stubs/pyserial/serial/tools/miniterm.pyi | 2 +- stubs/pysftp/pysftp/__init__.pyi | 3 +-- stubs/python-crontab/cronlog.pyi | 2 +- stubs/python-crontab/crontab.pyi | 3 +-- stubs/python-dateutil/dateutil/_common.pyi | 2 +- stubs/python-dateutil/dateutil/relativedelta.pyi | 3 +-- stubs/python-jose/jose/backends/base.pyi | 2 +- stubs/python-jose/jose/backends/ecdsa_backend.pyi | 2 +- stubs/python-jose/jose/backends/rsa_backend.pyi | 2 +- stubs/pywin32/_win32typing.pyi | 3 +-- stubs/redis/redis/asyncio/client.pyi | 3 +-- stubs/redis/redis/asyncio/cluster.pyi | 2 +- stubs/redis/redis/asyncio/lock.pyi | 2 +- stubs/redis/redis/client.pyi | 3 +-- stubs/redis/redis/cluster.pyi | 3 +-- stubs/redis/redis/connection.pyi | 3 +-- stubs/redis/redis/lock.pyi | 2 +- stubs/regex/regex/_regex.pyi | 3 +-- stubs/regex/regex/regex.pyi | 3 +-- stubs/requests/requests/models.pyi | 2 +- stubs/requests/requests/sessions.pyi | 3 +-- stubs/setuptools/pkg_resources/__init__.pyi | 3 +-- stubs/setuptools/setuptools/_distutils/version.pyi | 2 +- stubs/setuptools/setuptools/command/test.pyi | 2 +- stubs/slumber/slumber/__init__.pyi | 2 +- .../stripe/api_resources/abstract/api_resource.pyi | 2 +- .../abstract/createable_api_resource.pyi | 2 +- .../abstract/deletable_api_resource.pyi | 2 +- .../abstract/searchable_api_resource.pyi | 2 +- .../abstract/updateable_api_resource.pyi | 2 +- .../stripe/api_resources/application_fee_refund.pyi | 2 +- stubs/stripe/stripe/api_resources/invoice.pyi | 2 +- .../stripe/stripe/api_resources/payment_method.pyi | 2 +- .../stripe/api_resources/search_result_object.pyi | 3 +-- .../api_resources/test_helpers/test_clock.pyi | 3 +-- stubs/stripe/stripe/stripe_object.pyi | 2 +- stubs/tensorflow/tensorflow/__init__.pyi | 3 +-- stubs/toml/toml/tz.pyi | 2 +- stubs/tqdm/tqdm/asyncio.pyi | 2 +- stubs/tqdm/tqdm/dask.pyi | 2 +- stubs/tqdm/tqdm/std.pyi | 3 +-- stubs/untangle/untangle.pyi | 2 +- stubs/urllib3/urllib3/connectionpool.pyi | 3 +-- stubs/urllib3/urllib3/response.pyi | 3 +-- stubs/urllib3/urllib3/util/retry.pyi | 3 +-- 140 files changed, 148 insertions(+), 232 deletions(-) diff --git a/stubs/DateTimeRange/datetimerange/__init__.pyi b/stubs/DateTimeRange/datetimerange/__init__.pyi index 4978cc501af2..8eddea5b6aa8 100644 --- a/stubs/DateTimeRange/datetimerange/__init__.pyi +++ b/stubs/DateTimeRange/datetimerange/__init__.pyi @@ -1,7 +1,7 @@ -from typing_extensions import Self import datetime from collections.abc import Iterable from typing import ClassVar +from typing_extensions import Self from dateutil.relativedelta import relativedelta diff --git a/stubs/ExifRead/exifread/utils.pyi b/stubs/ExifRead/exifread/utils.pyi index 5b0b09f8e54b..d534019c3683 100644 --- a/stubs/ExifRead/exifread/utils.pyi +++ b/stubs/ExifRead/exifread/utils.pyi @@ -1,7 +1,7 @@ -from typing_extensions import Self from collections.abc import Mapping from fractions import Fraction from typing import Any, TypeVar, overload +from typing_extensions import Self _T = TypeVar("_T") diff --git a/stubs/JACK-Client/jack/__init__.pyi b/stubs/JACK-Client/jack/__init__.pyi index 2057024ef443..cbe7c6c82d0c 100644 --- a/stubs/JACK-Client/jack/__init__.pyi +++ b/stubs/JACK-Client/jack/__init__.pyi @@ -1,8 +1,7 @@ -from typing_extensions import Self import sys from collections.abc import Callable, Generator, Iterable, Iterator, Sequence from typing import Any, NoReturn, overload -from typing_extensions import Literal +from typing_extensions import Literal, Self import numpy from _cffi_backend import _CDataBase diff --git a/stubs/Markdown/markdown/core.pyi b/stubs/Markdown/markdown/core.pyi index 25843d76e794..394417945f90 100644 --- a/stubs/Markdown/markdown/core.pyi +++ b/stubs/Markdown/markdown/core.pyi @@ -1,7 +1,6 @@ -from typing_extensions import Self from collections.abc import Callable, Mapping, Sequence from typing import Any, ClassVar, Protocol -from typing_extensions import Literal +from typing_extensions import Literal, Self from xml.etree.ElementTree import Element from .blockparser import BlockParser diff --git a/stubs/Pillow/PIL/Image.pyi b/stubs/Pillow/PIL/Image.pyi index 4389a0608b06..31b71700d2cf 100644 --- a/stubs/Pillow/PIL/Image.pyi +++ b/stubs/Pillow/PIL/Image.pyi @@ -1,10 +1,9 @@ -from typing_extensions import Self from _typeshed import Incomplete, SupportsRead, SupportsWrite from collections.abc import Callable, Iterable, Iterator, MutableMapping, Sequence from enum import IntEnum from pathlib import Path from typing import Any, ClassVar, Protocol, SupportsBytes -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias from PIL.PyAccess import PyAccess diff --git a/stubs/Pillow/PIL/ImageFile.pyi b/stubs/Pillow/PIL/ImageFile.pyi index 411e1f53589c..b4c6ebdc07be 100644 --- a/stubs/Pillow/PIL/ImageFile.pyi +++ b/stubs/Pillow/PIL/ImageFile.pyi @@ -1,6 +1,6 @@ -from typing_extensions import Self from _typeshed import Incomplete from typing import Any, NoReturn +from typing_extensions import Self from .Image import Image diff --git a/stubs/Pillow/PIL/ImageFilter.pyi b/stubs/Pillow/PIL/ImageFilter.pyi index 53f7ef633493..bbb647a4b901 100644 --- a/stubs/Pillow/PIL/ImageFilter.pyi +++ b/stubs/Pillow/PIL/ImageFilter.pyi @@ -1,8 +1,7 @@ -from typing_extensions import Self from _typeshed import Incomplete from collections.abc import Callable, Iterable, Sequence from typing import Any -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias from .Image import Image diff --git a/stubs/PyMySQL/pymysql/connections.pyi b/stubs/PyMySQL/pymysql/connections.pyi index e71426008aff..e17b91807b65 100644 --- a/stubs/PyMySQL/pymysql/connections.pyi +++ b/stubs/PyMySQL/pymysql/connections.pyi @@ -1,8 +1,8 @@ -from typing_extensions import Self from _typeshed import Incomplete from collections.abc import Mapping from socket import socket as _socket from typing import Any, AnyStr, Generic, TypeVar, overload +from typing_extensions import Self from .charset import charset_by_id as charset_by_id, charset_by_name as charset_by_name from .constants import CLIENT as CLIENT, COMMAND as COMMAND, FIELD_TYPE as FIELD_TYPE, SERVER_STATUS as SERVER_STATUS diff --git a/stubs/PyMySQL/pymysql/cursors.pyi b/stubs/PyMySQL/pymysql/cursors.pyi index a005b52a9cc8..4f2d374b97ae 100644 --- a/stubs/PyMySQL/pymysql/cursors.pyi +++ b/stubs/PyMySQL/pymysql/cursors.pyi @@ -1,6 +1,6 @@ -from typing_extensions import Self from collections.abc import Iterable, Iterator from typing import Any +from typing_extensions import Self from .connections import Connection diff --git a/stubs/Pygments/pygments/token.pyi b/stubs/Pygments/pygments/token.pyi index f24e58842c5f..cd63f2b61158 100644 --- a/stubs/Pygments/pygments/token.pyi +++ b/stubs/Pygments/pygments/token.pyi @@ -1,6 +1,6 @@ -from typing_extensions import Self from collections.abc import Mapping from typing import Any +from typing_extensions import Self class _TokenType(tuple[str, ...]): parent: _TokenType | None diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi index 59dc6fc7fa3e..9d7376520a9f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi @@ -1,11 +1,10 @@ -from typing_extensions import Self from _typeshed import Incomplete from _typeshed.dbapi import DBAPIConnection from abc import abstractmethod from collections.abc import Callable, Mapping from types import TracebackType from typing import Any, TypeVar, overload -from typing_extensions import Concatenate, ParamSpec, TypeAlias +from typing_extensions import Concatenate, ParamSpec, Self, TypeAlias from ..log import Identified, _EchoFlag, echo_property from ..pool import Pool diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/mock.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/mock.pyi index c9de41730472..bfd8007258db 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/mock.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/mock.pyi @@ -1,7 +1,7 @@ -from typing_extensions import Self from abc import abstractmethod from collections.abc import Mapping from typing import Any, overload +from typing_extensions import Self from .base import _Executable from .cursor import CursorResult diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi index 4194d913cabb..7328eb5e2f4f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi @@ -1,7 +1,7 @@ -from typing_extensions import Self from _typeshed import Incomplete from collections.abc import Generator, KeysView from typing import Any +from typing_extensions import Self from ..sql.base import InPlaceGenerative from .row import Row diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi index f3dcbc07afa2..cb70b3cce3b6 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi @@ -1,8 +1,7 @@ -from typing_extensions import Self from _typeshed import SupportsItems from collections.abc import Iterable, Mapping, Sequence from typing import Any, NamedTuple -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias from ..util import immutabledict from .interfaces import Dialect diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/util.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/util.pyi index 38d001341bdc..0fdef74350e3 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/util.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/util.pyi @@ -1,7 +1,7 @@ -from typing_extensions import Self from collections.abc import Callable from types import TracebackType from typing import Any +from typing_extensions import Self def connection_memoize(key: str) -> Callable[..., Any]: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi index 3babfc8edbde..a7353820c5e2 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi @@ -1,6 +1,6 @@ -from typing_extensions import Self from _typeshed import Incomplete from typing import Any +from typing_extensions import Self from ...util import memoized_property from .base import ReversibleProxy, StartableContext diff --git a/stubs/SQLAlchemy/sqlalchemy/log.pyi b/stubs/SQLAlchemy/sqlalchemy/log.pyi index d00fba81addb..e4ccc821e6a5 100644 --- a/stubs/SQLAlchemy/sqlalchemy/log.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/log.pyi @@ -1,7 +1,6 @@ -from typing_extensions import Self from logging import Logger from typing import Any, TypeVar, overload -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias _ClsT = TypeVar("_ClsT", bound=type) _EchoFlag: TypeAlias = bool | Literal["debug"] | None diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi index 8f90f6351cd7..ab769f034319 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi @@ -1,8 +1,7 @@ -from typing_extensions import Self from _typeshed import Incomplete from collections.abc import Iterator from typing import Any, Generic, TypeVar -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias from ..sql.annotation import SupportsCloneAnnotations from ..sql.base import Executable @@ -67,12 +66,7 @@ class Query(_SelectFromElements, SupportsCloneAnnotations, HasPrefixes, HasSuffi def get_execution_options(self): ... def execution_options(self, **kwargs) -> Self: ... def with_for_update( - self, - read: bool = ..., - nowait: bool = ..., - of: Incomplete | None = ..., - skip_locked: bool = ..., - key_share: bool = ..., + self, read: bool = ..., nowait: bool = ..., of: Incomplete | None = ..., skip_locked: bool = ..., key_share: bool = ... ) -> Self: ... def params(self, *args, **kwargs) -> Self: ... def where(self, *criterion): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi index da35218ef1ab..09e4acb21134 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi @@ -1,7 +1,7 @@ -from typing_extensions import Self from _typeshed import Incomplete from collections.abc import Mapping from typing import Any, TypeVar, overload +from typing_extensions import Self from ..engine.base import Connection from ..engine.result import Result diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi index 59e0773a8259..885aac1d0045 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi @@ -1,7 +1,7 @@ -from typing_extensions import Self from _typeshed import Incomplete from collections.abc import MutableMapping from typing import Any, ClassVar +from typing_extensions import Self from .. import util from ..util import HasMemoized, hybridmethod, memoized_property diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi index 1cd13e081a61..93c53c0c5c65 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi @@ -1,7 +1,6 @@ -from typing_extensions import Self from _typeshed import Incomplete from typing import Any, Generic, TypeVar -from typing_extensions import Literal +from typing_extensions import Literal, Self from .. import util from ..util import HasMemoized, memoized_property diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi index 1d350a4e0207..eb24ab00c8f7 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi @@ -1,6 +1,6 @@ -from typing_extensions import Self from _typeshed import Incomplete from typing import Any +from typing_extensions import Self from .. import util from ..util import HasMemoized, memoized_property @@ -252,12 +252,7 @@ class GenerativeSelect(DeprecatedSelectBaseGenerations, SelectBase): bind: Incomplete | None = ..., ) -> None: ... def with_for_update( - self, - nowait: bool = ..., - read: bool = ..., - of: Incomplete | None = ..., - skip_locked: bool = ..., - key_share: bool = ..., + self, nowait: bool = ..., read: bool = ..., of: Incomplete | None = ..., skip_locked: bool = ..., key_share: bool = ... ) -> Self: ... def get_label_style(self): ... def set_label_style(self, style): ... @@ -347,9 +342,7 @@ class Select( def from_statement(self, statement): ... def join(self, target, onclause: Incomplete | None = ..., isouter: bool = ..., full: bool = ...) -> Self: ... def outerjoin_from(self, from_, target, onclause: Incomplete | None = ..., full: bool = ...): ... - def join_from( - self, from_, target, onclause: Incomplete | None = ..., isouter: bool = ..., full: bool = ... - ) -> Self: ... + def join_from(self, from_, target, onclause: Incomplete | None = ..., isouter: bool = ..., full: bool = ...) -> Self: ... def outerjoin(self, target, onclause: Incomplete | None = ..., full: bool = ...): ... def get_final_froms(self): ... @property diff --git a/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi b/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi index 52dea187a5cd..7cbd0588c46b 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi @@ -1,8 +1,8 @@ -from typing_extensions import Self import collections.abc from _typeshed import Incomplete, SupportsKeysAndGetItem from collections.abc import Callable, Iterable, Iterator, Mapping from typing import Any, Generic, NoReturn, TypeVar, overload +from typing_extensions import Self from ..cimmutabledict import immutabledict as immutabledict diff --git a/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi b/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi index 44535e7fcba1..c38631426b18 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi @@ -1,7 +1,7 @@ -from typing_extensions import Self from _typeshed import Incomplete from collections.abc import Callable from typing import Any, Generic, TypeVar, overload +from typing_extensions import Self from . import compat diff --git a/stubs/aiofiles/aiofiles/base.pyi b/stubs/aiofiles/aiofiles/base.pyi index 4d1b2890d58a..cc9baf4a99f9 100644 --- a/stubs/aiofiles/aiofiles/base.pyi +++ b/stubs/aiofiles/aiofiles/base.pyi @@ -1,7 +1,7 @@ -from typing_extensions import Self from collections.abc import Coroutine, Generator, Iterator from types import CodeType, FrameType, TracebackType, coroutine from typing import Any, Generic, TypeVar +from typing_extensions import Self _T = TypeVar("_T") _T_co = TypeVar("_T_co", covariant=True) diff --git a/stubs/aws-xray-sdk/aws_xray_sdk/core/models/trace_header.pyi b/stubs/aws-xray-sdk/aws_xray_sdk/core/models/trace_header.pyi index c48e0a4cfe23..cb34fbaab771 100644 --- a/stubs/aws-xray-sdk/aws_xray_sdk/core/models/trace_header.pyi +++ b/stubs/aws-xray-sdk/aws_xray_sdk/core/models/trace_header.pyi @@ -1,5 +1,5 @@ -from typing_extensions import Self from typing import Any +from typing_extensions import Self log: Any ROOT: str diff --git a/stubs/beautifulsoup4/bs4/__init__.pyi b/stubs/beautifulsoup4/bs4/__init__.pyi index d77c59b046f7..21ed6f204cdb 100644 --- a/stubs/beautifulsoup4/bs4/__init__.pyi +++ b/stubs/beautifulsoup4/bs4/__init__.pyi @@ -1,7 +1,7 @@ -from typing_extensions import Self from _typeshed import Incomplete, SupportsRead from collections.abc import Sequence from typing import Any +from typing_extensions import Self from .builder import ParserRejectedMarkup as ParserRejectedMarkup, TreeBuilder, XMLParsedAsHTMLWarning as XMLParsedAsHTMLWarning from .element import ( diff --git a/stubs/beautifulsoup4/bs4/element.pyi b/stubs/beautifulsoup4/bs4/element.pyi index 0f41d1877fd8..f7fa39afae07 100644 --- a/stubs/beautifulsoup4/bs4/element.pyi +++ b/stubs/beautifulsoup4/bs4/element.pyi @@ -1,9 +1,8 @@ -from typing_extensions import Self from _typeshed import Incomplete from collections.abc import Callable, Iterable, Iterator from re import Pattern from typing import Any, Generic, TypeVar, overload -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias from . import BeautifulSoup from .builder import TreeBuilder diff --git a/stubs/caldav/caldav/davclient.pyi b/stubs/caldav/caldav/davclient.pyi index 72cf7612be3b..002bd44f15d2 100644 --- a/stubs/caldav/caldav/davclient.pyi +++ b/stubs/caldav/caldav/davclient.pyi @@ -1,7 +1,6 @@ -from typing_extensions import Self from collections.abc import Iterable, Mapping from typing import Any -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias from urllib.parse import ParseResult, SplitResult from requests.auth import AuthBase diff --git a/stubs/caldav/caldav/elements/base.pyi b/stubs/caldav/caldav/elements/base.pyi index 5417d2f95286..c55dbf7d0dac 100644 --- a/stubs/caldav/caldav/elements/base.pyi +++ b/stubs/caldav/caldav/elements/base.pyi @@ -1,8 +1,7 @@ -from typing_extensions import Self from _typeshed import Incomplete from collections.abc import Iterable from typing import Any, ClassVar -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias _Element: TypeAlias = Any # actually lxml.etree._Element diff --git a/stubs/caldav/caldav/objects.pyi b/stubs/caldav/caldav/objects.pyi index d2769297a03f..310ad7210518 100644 --- a/stubs/caldav/caldav/objects.pyi +++ b/stubs/caldav/caldav/objects.pyi @@ -1,9 +1,8 @@ -from typing_extensions import Self import datetime from _typeshed import Incomplete from collections.abc import Iterable, Iterator, Mapping, Sequence from typing import Any, TypeVar, overload -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias from urllib.parse import ParseResult, SplitResult from vobject.base import VBase diff --git a/stubs/click-spinner/click_spinner/__init__.pyi b/stubs/click-spinner/click_spinner/__init__.pyi index 753f88a5a557..8b3a64fcb9f1 100644 --- a/stubs/click-spinner/click_spinner/__init__.pyi +++ b/stubs/click-spinner/click_spinner/__init__.pyi @@ -1,9 +1,8 @@ -from typing_extensions import Self import threading from collections.abc import Iterator from types import TracebackType from typing import Protocol -from typing_extensions import Literal +from typing_extensions import Literal, Self __version__: str diff --git a/stubs/croniter/croniter/croniter.pyi b/stubs/croniter/croniter/croniter.pyi index 7ed4efb42f37..a0823b8c45c3 100644 --- a/stubs/croniter/croniter/croniter.pyi +++ b/stubs/croniter/croniter/croniter.pyi @@ -1,11 +1,10 @@ -from typing_extensions import Self import datetime from _typeshed import ReadableBuffer from collections import OrderedDict from collections.abc import Iterator from re import Match, Pattern from typing import Any, overload -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias _RetType: TypeAlias = type[float | datetime.datetime] diff --git a/stubs/dateparser/dateparser/conf.pyi b/stubs/dateparser/dateparser/conf.pyi index ef9ed00a6fac..08883e8846a8 100644 --- a/stubs/dateparser/dateparser/conf.pyi +++ b/stubs/dateparser/dateparser/conf.pyi @@ -1,6 +1,6 @@ -from typing_extensions import Self from _typeshed import Incomplete from typing import Any +from typing_extensions import Self class Settings: def __new__(cls, *args, **kw) -> Self: ... diff --git a/stubs/docutils/docutils/__init__.pyi b/stubs/docutils/docutils/__init__.pyi index d6b5f3448855..1a2f9df43aea 100644 --- a/stubs/docutils/docutils/__init__.pyi +++ b/stubs/docutils/docutils/__init__.pyi @@ -1,5 +1,5 @@ -from typing_extensions import Self from typing import Any, ClassVar, NamedTuple +from typing_extensions import Self __docformat__: str __version__: str @@ -14,13 +14,7 @@ class _VersionInfo(NamedTuple): class VersionInfo(_VersionInfo): def __new__( - cls, - major: int = ..., - minor: int = ..., - micro: int = ..., - releaselevel: str = ..., - serial: int = ..., - release: bool = ..., + cls, major: int = ..., minor: int = ..., micro: int = ..., releaselevel: str = ..., serial: int = ..., release: bool = ... ) -> Self: ... __version_info__: VersionInfo diff --git a/stubs/docutils/docutils/nodes.pyi b/stubs/docutils/docutils/nodes.pyi index 25c039367bb2..80ee6bbe792b 100644 --- a/stubs/docutils/docutils/nodes.pyi +++ b/stubs/docutils/docutils/nodes.pyi @@ -1,10 +1,9 @@ -from typing_extensions import Self import xml.dom.minidom from _typeshed import Incomplete from abc import abstractmethod from collections.abc import Callable, Generator, Iterable, Sequence from typing import Any, ClassVar, Protocol, TypeVar, overload -from typing_extensions import Literal +from typing_extensions import Literal, Self from docutils.transforms import Transformer diff --git a/stubs/entrypoints/entrypoints.pyi b/stubs/entrypoints/entrypoints.pyi index a76fc9195de5..08e89ec5ad10 100644 --- a/stubs/entrypoints/entrypoints.pyi +++ b/stubs/entrypoints/entrypoints.pyi @@ -1,8 +1,8 @@ -from typing_extensions import Self import sys from collections.abc import Iterator, Sequence from configparser import ConfigParser from typing import Any +from typing_extensions import Self if sys.version_info >= (3, 8): from re import Pattern diff --git a/stubs/fpdf2/fpdf/drawing.pyi b/stubs/fpdf2/fpdf/drawing.pyi index da91a00dfaa6..24a1b543c93e 100644 --- a/stubs/fpdf2/fpdf/drawing.pyi +++ b/stubs/fpdf2/fpdf/drawing.pyi @@ -1,4 +1,3 @@ -from typing_extensions import Self import decimal from _typeshed import Incomplete from collections import OrderedDict @@ -6,7 +5,7 @@ from collections.abc import Callable, Generator, Iterator from contextlib import contextmanager from re import Pattern from typing import Any, ClassVar, NamedTuple, TypeVar -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias from .syntax import Name, Raw diff --git a/stubs/fpdf2/fpdf/enums.pyi b/stubs/fpdf2/fpdf/enums.pyi index 68dd2692c7a7..9f82c6008301 100644 --- a/stubs/fpdf2/fpdf/enums.pyi +++ b/stubs/fpdf2/fpdf/enums.pyi @@ -1,6 +1,5 @@ -from typing_extensions import Self from enum import Enum, Flag, IntEnum, IntFlag -from typing_extensions import Literal +from typing_extensions import Literal, Self from .syntax import Name 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 a24f5937ef01..8a495a68c568 100644 --- a/stubs/google-cloud-ndb/google/cloud/ndb/global_cache.pyi +++ b/stubs/google-cloud-ndb/google/cloud/ndb/global_cache.pyi @@ -1,7 +1,7 @@ -from typing_extensions import Self import abc from _typeshed import Incomplete from typing import Any +from typing_extensions import Self ConnectionError: Any @@ -61,9 +61,7 @@ class MemcacheCache(GlobalCache): def __eq__(self, other): ... transient_errors: Any @classmethod - def from_environment( - cls, max_pool_size: int = ..., strict_read: bool = ..., strict_write: bool = ... - ) -> Self: ... + def from_environment(cls, max_pool_size: int = ..., strict_read: bool = ..., strict_write: bool = ...) -> Self: ... client: Any strict_read: Any strict_write: Any diff --git a/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi b/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi index e990d478c251..10ba251a8acb 100644 --- a/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi +++ b/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi @@ -1,8 +1,7 @@ -from typing_extensions import Self import datetime from collections.abc import Callable, Iterable, Sequence from typing import Any, NoReturn -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias from google.cloud.ndb import exceptions, key as key_module, query as query_module, tasklets as tasklets_module diff --git a/stubs/httplib2/httplib2/__init__.pyi b/stubs/httplib2/httplib2/__init__.pyi index 427c1727a4fb..485c09178822 100644 --- a/stubs/httplib2/httplib2/__init__.pyi +++ b/stubs/httplib2/httplib2/__init__.pyi @@ -1,8 +1,8 @@ -from typing_extensions import Self import http.client from _typeshed import Incomplete from collections.abc import Generator from typing import Any, ClassVar +from typing_extensions import Self from .error import * diff --git a/stubs/ibm-db/ibm_db.pyi b/stubs/ibm-db/ibm_db.pyi index ff2d4b9a9bdd..ba3063500733 100644 --- a/stubs/ibm-db/ibm_db.pyi +++ b/stubs/ibm-db/ibm_db.pyi @@ -1,6 +1,5 @@ -from typing_extensions import Self from typing import Any, overload -from typing_extensions import final +from typing_extensions import Self, final ATTR_CASE: int CASE_LOWER: int diff --git a/stubs/influxdb-client/influxdb_client/client/flux_csv_parser.pyi b/stubs/influxdb-client/influxdb_client/client/flux_csv_parser.pyi index 778f2a340425..0a96f5f6eb10 100644 --- a/stubs/influxdb-client/influxdb_client/client/flux_csv_parser.pyi +++ b/stubs/influxdb-client/influxdb_client/client/flux_csv_parser.pyi @@ -1,7 +1,7 @@ -from typing_extensions import Self from _typeshed import Incomplete from collections.abc import Generator from enum import Enum +from typing_extensions import Self from influxdb_client.client.flux_table import TableList diff --git a/stubs/influxdb-client/influxdb_client/client/influxdb_client.pyi b/stubs/influxdb-client/influxdb_client/client/influxdb_client.pyi index 58e3de3589c8..6b5254989aad 100644 --- a/stubs/influxdb-client/influxdb_client/client/influxdb_client.pyi +++ b/stubs/influxdb-client/influxdb_client/client/influxdb_client.pyi @@ -1,5 +1,5 @@ -from typing_extensions import Self from _typeshed import Incomplete +from typing_extensions import Self from influxdb_client import HealthCheck, InvokableScriptsApi, Ready from influxdb_client.client._base import _BaseClient diff --git a/stubs/influxdb-client/influxdb_client/client/influxdb_client_async.pyi b/stubs/influxdb-client/influxdb_client/client/influxdb_client_async.pyi index a810beaae5db..daad06d7b3a1 100644 --- a/stubs/influxdb-client/influxdb_client/client/influxdb_client_async.pyi +++ b/stubs/influxdb-client/influxdb_client/client/influxdb_client_async.pyi @@ -1,5 +1,5 @@ -from typing_extensions import Self from _typeshed import Incomplete +from typing_extensions import Self from influxdb_client.client._base import _BaseClient from influxdb_client.client.delete_api_async import DeleteApiAsync diff --git a/stubs/influxdb-client/influxdb_client/client/write/point.pyi b/stubs/influxdb-client/influxdb_client/client/write/point.pyi index b44873195f24..d18ecc289a74 100644 --- a/stubs/influxdb-client/influxdb_client/client/write/point.pyi +++ b/stubs/influxdb-client/influxdb_client/client/write/point.pyi @@ -1,10 +1,9 @@ -from typing_extensions import Self from _typeshed import Incomplete, SupportsGetItem, SupportsItems from collections.abc import Iterable from datetime import datetime, timedelta from numbers import Integral from typing import Any -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias from influxdb_client.domain.write_precision import _WritePrecision diff --git a/stubs/invoke/invoke/tasks.pyi b/stubs/invoke/invoke/tasks.pyi index 08f0822d7b46..0240aca9f6bb 100644 --- a/stubs/invoke/invoke/tasks.pyi +++ b/stubs/invoke/invoke/tasks.pyi @@ -1,8 +1,7 @@ -from typing_extensions import Self from _typeshed import Incomplete from collections.abc import Callable, Iterable from typing import Any, Generic, TypeVar, overload -from typing_extensions import ParamSpec +from typing_extensions import ParamSpec, Self from .config import Config from .context import Context diff --git a/stubs/jsonschema/jsonschema/exceptions.pyi b/stubs/jsonschema/jsonschema/exceptions.pyi index 4971067fdbe0..a61828da1554 100644 --- a/stubs/jsonschema/jsonschema/exceptions.pyi +++ b/stubs/jsonschema/jsonschema/exceptions.pyi @@ -1,9 +1,8 @@ -from typing_extensions import Self from _typeshed import Incomplete, SupportsRichComparison from collections import deque from collections.abc import Callable, Container, Iterable, Sequence from typing import Any -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias from jsonschema import _utils, protocols from jsonschema._types import TypeChecker diff --git a/stubs/ldap3/ldap3/core/connection.pyi b/stubs/ldap3/ldap3/core/connection.pyi index fc28e6c17c46..0e5b29c7ab58 100644 --- a/stubs/ldap3/ldap3/core/connection.pyi +++ b/stubs/ldap3/ldap3/core/connection.pyi @@ -1,8 +1,7 @@ -from typing_extensions import Self from _collections_abc import Generator, dict_keys -from _typeshed import Incomplete, ReadableBuffer +from _typeshed import Incomplete, ReadableBuffer from types import TracebackType -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias from pyasn1.type.base import Asn1Item diff --git a/stubs/ldap3/ldap3/core/exceptions.pyi b/stubs/ldap3/ldap3/core/exceptions.pyi index c36d7089431c..7da6a70afa1f 100644 --- a/stubs/ldap3/ldap3/core/exceptions.pyi +++ b/stubs/ldap3/ldap3/core/exceptions.pyi @@ -1,7 +1,7 @@ -from typing_extensions import Self import socket from _typeshed import Incomplete from typing import Any +from typing_extensions import Self class LDAPException(Exception): ... diff --git a/stubs/mock/mock/mock.pyi b/stubs/mock/mock/mock.pyi index 91eb9fa79f96..518478b22e74 100644 --- a/stubs/mock/mock/mock.pyi +++ b/stubs/mock/mock/mock.pyi @@ -1,10 +1,9 @@ -from typing_extensions import Self from _typeshed import Incomplete from collections.abc import Callable, Coroutine, Mapping, Sequence from contextlib import AbstractContextManager from types import TracebackType from typing import Any, Generic, TypeVar, overload -from typing_extensions import Literal +from typing_extensions import Literal, Self _F = TypeVar("_F", bound=Callable[..., Any]) _AF = TypeVar("_AF", bound=Callable[..., Coroutine[Any, Any, Any]]) diff --git a/stubs/mypy-extensions/mypy_extensions.pyi b/stubs/mypy-extensions/mypy_extensions.pyi index d4a61a7cff7c..7bc5c1fbfd4d 100644 --- a/stubs/mypy-extensions/mypy_extensions.pyi +++ b/stubs/mypy-extensions/mypy_extensions.pyi @@ -1,11 +1,10 @@ -from typing_extensions import Self import abc import sys from _collections_abc import dict_items, dict_keys, dict_values from _typeshed import IdentityFunction from collections.abc import Mapping from typing import Any, ClassVar, Generic, TypeVar, overload, type_check_only -from typing_extensions import Never +from typing_extensions import Never, Self _T = TypeVar("_T") _U = TypeVar("_U") diff --git a/stubs/mysqlclient/MySQLdb/connections.pyi b/stubs/mysqlclient/MySQLdb/connections.pyi index 826b26022e09..d1034859a71d 100644 --- a/stubs/mysqlclient/MySQLdb/connections.pyi +++ b/stubs/mysqlclient/MySQLdb/connections.pyi @@ -1,6 +1,6 @@ -from typing_extensions import Self from types import TracebackType from typing import Any +from typing_extensions import Self from . import _mysql, cursors from ._exceptions import ( diff --git a/stubs/netaddr/netaddr/eui/__init__.pyi b/stubs/netaddr/netaddr/eui/__init__.pyi index ee19bced060f..9d2b963e02dc 100644 --- a/stubs/netaddr/netaddr/eui/__init__.pyi +++ b/stubs/netaddr/netaddr/eui/__init__.pyi @@ -1,6 +1,5 @@ -from typing_extensions import Self from typing import ClassVar, SupportsInt, overload -from typing_extensions import Literal, SupportsIndex +from typing_extensions import Literal, Self, SupportsIndex from netaddr.core import DictDotLookup from netaddr.ip import IPAddress diff --git a/stubs/netaddr/netaddr/ip/__init__.pyi b/stubs/netaddr/netaddr/ip/__init__.pyi index d3ae3af2d8f0..b688de8582b7 100644 --- a/stubs/netaddr/netaddr/ip/__init__.pyi +++ b/stubs/netaddr/netaddr/ip/__init__.pyi @@ -1,9 +1,8 @@ -from typing_extensions import Self from _typeshed import Incomplete from abc import abstractmethod from collections.abc import Iterable, Iterator from typing import SupportsInt, overload -from typing_extensions import Literal, SupportsIndex, TypeAlias +from typing_extensions import Literal, Self, SupportsIndex, TypeAlias from netaddr.core import DictDotLookup from netaddr.strategy.ipv6 import ipv6_verbose diff --git a/stubs/netaddr/netaddr/ip/sets.pyi b/stubs/netaddr/netaddr/ip/sets.pyi index c33573cb36e9..ac6e2cb1b12d 100644 --- a/stubs/netaddr/netaddr/ip/sets.pyi +++ b/stubs/netaddr/netaddr/ip/sets.pyi @@ -1,7 +1,6 @@ -from typing_extensions import Self from collections.abc import Iterable, Iterator from typing import NoReturn -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias from netaddr.ip import IPAddress, IPNetwork, IPRange, _IPNetworkAddr diff --git a/stubs/opentracing/opentracing/mocktracer/context.pyi b/stubs/opentracing/opentracing/mocktracer/context.pyi index 4f2cf7cc6ad5..3264dd824567 100644 --- a/stubs/opentracing/opentracing/mocktracer/context.pyi +++ b/stubs/opentracing/opentracing/mocktracer/context.pyi @@ -1,5 +1,5 @@ - from typing_extensions import Self + import opentracing class SpanContext(opentracing.SpanContext): diff --git a/stubs/opentracing/opentracing/mocktracer/span.pyi b/stubs/opentracing/opentracing/mocktracer/span.pyi index e7094eab5d12..9d310d5bf8ae 100644 --- a/stubs/opentracing/opentracing/mocktracer/span.pyi +++ b/stubs/opentracing/opentracing/mocktracer/span.pyi @@ -1,5 +1,5 @@ -from typing_extensions import Self from typing import Any +from typing_extensions import Self from ..span import Span from ..tracer import Tracer diff --git a/stubs/opentracing/opentracing/scope.pyi b/stubs/opentracing/opentracing/scope.pyi index 77b0568348f0..e312df143498 100644 --- a/stubs/opentracing/opentracing/scope.pyi +++ b/stubs/opentracing/opentracing/scope.pyi @@ -1,5 +1,5 @@ -from typing_extensions import Self from types import TracebackType +from typing_extensions import Self from .scope_manager import ScopeManager from .span import Span diff --git a/stubs/opentracing/opentracing/span.pyi b/stubs/opentracing/opentracing/span.pyi index f0ef7c59fa57..74a6dc5d2347 100644 --- a/stubs/opentracing/opentracing/span.pyi +++ b/stubs/opentracing/opentracing/span.pyi @@ -1,7 +1,7 @@ -from typing_extensions import Self from _typeshed import Incomplete from types import TracebackType from typing import Any +from typing_extensions import Self from .tracer import Tracer diff --git a/stubs/paramiko/paramiko/_winapi.pyi b/stubs/paramiko/paramiko/_winapi.pyi index 7017df87450f..2943652ef6d3 100644 --- a/stubs/paramiko/paramiko/_winapi.pyi +++ b/stubs/paramiko/paramiko/_winapi.pyi @@ -1,10 +1,10 @@ -from typing_extensions import Self import builtins import ctypes import sys from _typeshed import Incomplete from types import TracebackType from typing import Any +from typing_extensions import Self if sys.platform == "win32": def format_system_message(errno: int) -> str | None: ... diff --git a/stubs/paramiko/paramiko/config.pyi b/stubs/paramiko/paramiko/config.pyi index 509920cbd309..a7c30feaff58 100644 --- a/stubs/paramiko/paramiko/config.pyi +++ b/stubs/paramiko/paramiko/config.pyi @@ -1,7 +1,7 @@ -from typing_extensions import Self from collections.abc import Iterable from re import Pattern from typing import IO +from typing_extensions import Self from paramiko.ssh_exception import ConfigParseError as ConfigParseError, CouldNotCanonicalize as CouldNotCanonicalize diff --git a/stubs/paramiko/paramiko/hostkeys.pyi b/stubs/paramiko/paramiko/hostkeys.pyi index f66e4403cf63..c48011a5941d 100644 --- a/stubs/paramiko/paramiko/hostkeys.pyi +++ b/stubs/paramiko/paramiko/hostkeys.pyi @@ -1,5 +1,5 @@ -from typing_extensions import Self from collections.abc import Iterator, Mapping, MutableMapping +from typing_extensions import Self from paramiko.pkey import PKey diff --git a/stubs/paramiko/paramiko/pkey.pyi b/stubs/paramiko/paramiko/pkey.pyi index 9d1a6555de9f..9daefd8766e6 100644 --- a/stubs/paramiko/paramiko/pkey.pyi +++ b/stubs/paramiko/paramiko/pkey.pyi @@ -1,6 +1,6 @@ -from typing_extensions import Self from re import Pattern from typing import IO +from typing_extensions import Self from paramiko.message import Message diff --git a/stubs/paramiko/paramiko/sftp_attr.pyi b/stubs/paramiko/paramiko/sftp_attr.pyi index 68363587dddb..b97f99df637a 100644 --- a/stubs/paramiko/paramiko/sftp_attr.pyi +++ b/stubs/paramiko/paramiko/sftp_attr.pyi @@ -1,5 +1,5 @@ -from typing_extensions import Self from os import stat_result +from typing_extensions import Self class SFTPAttributes: FLAG_SIZE: int diff --git a/stubs/paramiko/paramiko/sftp_client.pyi b/stubs/paramiko/paramiko/sftp_client.pyi index 904e40887d6b..54d543b39427 100644 --- a/stubs/paramiko/paramiko/sftp_client.pyi +++ b/stubs/paramiko/paramiko/sftp_client.pyi @@ -1,8 +1,7 @@ -from typing_extensions import Self from collections.abc import Callable, Iterator from logging import Logger from typing import IO -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias from paramiko.channel import Channel from paramiko.sftp import BaseSFTP @@ -22,9 +21,7 @@ class SFTPClient(BaseSFTP, ClosingContextManager): logger: Logger def __init__(self, sock: Channel) -> None: ... @classmethod - def from_transport( - cls, t: Transport, window_size: int | None = ..., max_packet_size: int | None = ... - ) -> Self | None: ... + def from_transport(cls, t: Transport, window_size: int | None = ..., max_packet_size: int | None = ...) -> Self | None: ... def close(self) -> None: ... def get_channel(self) -> Channel | None: ... def listdir(self, path: str = ...) -> list[str]: ... diff --git a/stubs/paramiko/paramiko/util.pyi b/stubs/paramiko/paramiko/util.pyi index 8dbda68dfe6b..7f94a074f851 100644 --- a/stubs/paramiko/paramiko/util.pyi +++ b/stubs/paramiko/paramiko/util.pyi @@ -1,8 +1,8 @@ -from typing_extensions import Self from hashlib import _Hash from logging import Logger, LogRecord from types import TracebackType from typing import IO, AnyStr, Protocol +from typing_extensions import Self from paramiko.config import SSHConfig, SSHConfigDict from paramiko.hostkeys import HostKeys diff --git a/stubs/parsimonious/parsimonious/expressions.pyi b/stubs/parsimonious/parsimonious/expressions.pyi index ba4ee5debb2e..eef53891639e 100644 --- a/stubs/parsimonious/parsimonious/expressions.pyi +++ b/stubs/parsimonious/parsimonious/expressions.pyi @@ -1,9 +1,8 @@ -from typing_extensions import Self import collections.abc from collections.abc import Callable, Mapping from re import Pattern from typing import Any -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias from parsimonious.exceptions import ParseError from parsimonious.grammar import Grammar diff --git a/stubs/passlib/passlib/context.pyi b/stubs/passlib/passlib/context.pyi index e5e7741ec206..f2c511a36039 100644 --- a/stubs/passlib/passlib/context.pyi +++ b/stubs/passlib/passlib/context.pyi @@ -1,6 +1,6 @@ -from typing_extensions import Self from _typeshed import Incomplete, StrOrBytesPath, SupportsItems from typing import Any +from typing_extensions import Self class CryptPolicy: @classmethod diff --git a/stubs/passlib/passlib/handlers/pbkdf2.pyi b/stubs/passlib/passlib/handlers/pbkdf2.pyi index 993f83c5f250..280849de8fb4 100644 --- a/stubs/passlib/passlib/handlers/pbkdf2.pyi +++ b/stubs/passlib/passlib/handlers/pbkdf2.pyi @@ -1,5 +1,5 @@ -from typing_extensions import Self from typing import ClassVar +from typing_extensions import Self import passlib.utils.handlers as uh from passlib.utils.handlers import PrefixWrapper diff --git a/stubs/passlib/passlib/handlers/phpass.pyi b/stubs/passlib/passlib/handlers/phpass.pyi index b98efd917d48..02419bdc8fec 100644 --- a/stubs/passlib/passlib/handlers/phpass.pyi +++ b/stubs/passlib/passlib/handlers/phpass.pyi @@ -1,5 +1,5 @@ -from typing_extensions import Self from typing import ClassVar +from typing_extensions import Self import passlib.utils.handlers as uh diff --git a/stubs/passlib/passlib/handlers/sha1_crypt.pyi b/stubs/passlib/passlib/handlers/sha1_crypt.pyi index b5daa4ca72d0..14ea298da770 100644 --- a/stubs/passlib/passlib/handlers/sha1_crypt.pyi +++ b/stubs/passlib/passlib/handlers/sha1_crypt.pyi @@ -1,5 +1,5 @@ -from typing_extensions import Self from typing import Any, ClassVar +from typing_extensions import Self import passlib.utils.handlers as uh diff --git a/stubs/passlib/passlib/handlers/sha2_crypt.pyi b/stubs/passlib/passlib/handlers/sha2_crypt.pyi index ff8d7261e85e..82ba37af28af 100644 --- a/stubs/passlib/passlib/handlers/sha2_crypt.pyi +++ b/stubs/passlib/passlib/handlers/sha2_crypt.pyi @@ -1,5 +1,5 @@ -from typing_extensions import Self from typing import ClassVar +from typing_extensions import Self import passlib.utils.handlers as uh diff --git a/stubs/passlib/passlib/handlers/sun_md5_crypt.pyi b/stubs/passlib/passlib/handlers/sun_md5_crypt.pyi index ebd0c80cc53d..43cb4a06c827 100644 --- a/stubs/passlib/passlib/handlers/sun_md5_crypt.pyi +++ b/stubs/passlib/passlib/handlers/sun_md5_crypt.pyi @@ -1,5 +1,5 @@ -from typing_extensions import Self from typing import ClassVar +from typing_extensions import Self import passlib.utils.handlers as uh diff --git a/stubs/passlib/passlib/ifc.pyi b/stubs/passlib/passlib/ifc.pyi index 95e99248e680..aec4570c8574 100644 --- a/stubs/passlib/passlib/ifc.pyi +++ b/stubs/passlib/passlib/ifc.pyi @@ -1,7 +1,6 @@ -from typing_extensions import Self from abc import ABCMeta, abstractmethod from typing import Any, ClassVar -from typing_extensions import Literal +from typing_extensions import Literal, Self class PasswordHash(metaclass=ABCMeta): is_disabled: ClassVar[bool] diff --git a/stubs/passlib/passlib/utils/handlers.pyi b/stubs/passlib/passlib/utils/handlers.pyi index 3b6cbb0995ec..89ede12fddbc 100644 --- a/stubs/passlib/passlib/utils/handlers.pyi +++ b/stubs/passlib/passlib/utils/handlers.pyi @@ -1,7 +1,7 @@ -from typing_extensions import Self import abc from _typeshed import Incomplete from typing import Any, ClassVar +from typing_extensions import Self from passlib.ifc import PasswordHash from passlib.utils.binary import BASE64_CHARS, HASH64_CHARS, LOWER_HEX_CHARS, PADDED_BASE64_CHARS, UPPER_HEX_CHARS diff --git a/stubs/peewee/peewee.pyi b/stubs/peewee/peewee.pyi index 456be3281ccb..a58a53a98e68 100644 --- a/stubs/peewee/peewee.pyi +++ b/stubs/peewee/peewee.pyi @@ -1,10 +1,10 @@ -from typing_extensions import Self import itertools import logging import threading from _typeshed import Incomplete, SupportsKeysAndGetItem from collections.abc import Generator, Iterable from typing import ClassVar, NamedTuple, TypeVar +from typing_extensions import Self class NullHandler(logging.Handler): def emit(self, record) -> None: ... diff --git a/stubs/pika/pika/adapters/asyncio_connection.pyi b/stubs/pika/pika/adapters/asyncio_connection.pyi index 90c6592709ba..621eb6fa2743 100644 --- a/stubs/pika/pika/adapters/asyncio_connection.pyi +++ b/stubs/pika/pika/adapters/asyncio_connection.pyi @@ -1,8 +1,8 @@ -from typing_extensions import Self from _typeshed import Incomplete from asyncio import AbstractEventLoop from collections.abc import Callable from logging import Logger +from typing_extensions import Self from ..connection import Parameters from .base_connection import BaseConnection diff --git a/stubs/pika/pika/adapters/base_connection.pyi b/stubs/pika/pika/adapters/base_connection.pyi index 4fc4b47b440b..db129fa75c6b 100644 --- a/stubs/pika/pika/adapters/base_connection.pyi +++ b/stubs/pika/pika/adapters/base_connection.pyi @@ -1,7 +1,7 @@ -from typing_extensions import Self import abc from _typeshed import Incomplete from collections.abc import Callable +from typing_extensions import Self from ..adapters.utils import nbio_interface from ..connection import Connection diff --git a/stubs/pika/pika/adapters/blocking_connection.pyi b/stubs/pika/pika/adapters/blocking_connection.pyi index 20591a17800f..5f330829c7a9 100644 --- a/stubs/pika/pika/adapters/blocking_connection.pyi +++ b/stubs/pika/pika/adapters/blocking_connection.pyi @@ -1,7 +1,7 @@ -from typing_extensions import Self from _typeshed import Incomplete from collections.abc import Generator, Sequence from typing import NamedTuple +from typing_extensions import Self from ..connection import Parameters from ..data import _ArgumentMapping diff --git a/stubs/pika/pika/channel.pyi b/stubs/pika/pika/channel.pyi index 9ef9dd603fda..3f28e847c17f 100644 --- a/stubs/pika/pika/channel.pyi +++ b/stubs/pika/pika/channel.pyi @@ -1,9 +1,8 @@ -from typing_extensions import Self from _typeshed import Incomplete from collections.abc import Callable from logging import Logger from typing import Any -from typing_extensions import Final +from typing_extensions import Final, Self from .callback import CallbackManager from .connection import Connection diff --git a/stubs/pika/pika/connection.pyi b/stubs/pika/pika/connection.pyi index 34831ba0153b..21024b427b72 100644 --- a/stubs/pika/pika/connection.pyi +++ b/stubs/pika/pika/connection.pyi @@ -1,9 +1,8 @@ -from typing_extensions import Self import abc from _typeshed import Incomplete from collections.abc import Callable from logging import Logger -from typing_extensions import Final +from typing_extensions import Final, Self from .callback import CallbackManager from .channel import Channel @@ -159,9 +158,7 @@ class Connection(AbstractBase, metaclass=abc.ABCMeta): internal_connection_workflow: bool = ..., ) -> None: ... def add_on_close_callback(self, callback: Callable[[Self, BaseException], object]) -> None: ... - def add_on_connection_blocked_callback( - self, callback: Callable[[Self, Method[SpecConnection.Blocked]], object] - ) -> None: ... + def add_on_connection_blocked_callback(self, callback: Callable[[Self, Method[SpecConnection.Blocked]], object]) -> None: ... def add_on_connection_unblocked_callback( self, callback: Callable[[Self, Method[SpecConnection.Unblocked]], object] ) -> None: ... diff --git a/stubs/pika/pika/spec.pyi b/stubs/pika/pika/spec.pyi index 39a1b4999ef9..c213867c06e6 100644 --- a/stubs/pika/pika/spec.pyi +++ b/stubs/pika/pika/spec.pyi @@ -1,7 +1,6 @@ -from typing_extensions import Self from _typeshed import Incomplete from typing import ClassVar -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias from .amqp_object import Class, Method, Properties diff --git a/stubs/protobuf/google/protobuf/message.pyi b/stubs/protobuf/google/protobuf/message.pyi index ae495cf073b3..798d00268724 100644 --- a/stubs/protobuf/google/protobuf/message.pyi +++ b/stubs/protobuf/google/protobuf/message.pyi @@ -1,6 +1,6 @@ -from typing_extensions import Self from collections.abc import Sequence from typing import Any, TypeVar +from typing_extensions import Self from .descriptor import Descriptor, FieldDescriptor from .internal.extension_dict import _ExtensionDict, _ExtensionFieldDescriptor diff --git a/stubs/psutil/psutil/__init__.pyi b/stubs/psutil/psutil/__init__.pyi index a37c2ec34638..f713d1bb943f 100644 --- a/stubs/psutil/psutil/__init__.pyi +++ b/stubs/psutil/psutil/__init__.pyi @@ -1,10 +1,9 @@ -from typing_extensions import Self import sys from _typeshed import Incomplete from collections.abc import Callable, Iterable, Iterator from contextlib import AbstractContextManager from typing import Any, overload -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias from psutil._common import ( AIX as AIX, diff --git a/stubs/psycopg2/psycopg2/_psycopg.pyi b/stubs/psycopg2/psycopg2/_psycopg.pyi index c45a16f99102..8f8565689077 100644 --- a/stubs/psycopg2/psycopg2/_psycopg.pyi +++ b/stubs/psycopg2/psycopg2/_psycopg.pyi @@ -1,8 +1,7 @@ -from typing_extensions import Self from collections.abc import Callable, Iterable, Mapping, Sequence from types import TracebackType from typing import Any, TypeVar, overload -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias import psycopg2 import psycopg2.extensions diff --git a/stubs/pyRFC3339/pyrfc3339/utils.pyi b/stubs/pyRFC3339/pyrfc3339/utils.pyi index 29c7be3b8b9f..492d3c221546 100644 --- a/stubs/pyRFC3339/pyrfc3339/utils.pyi +++ b/stubs/pyRFC3339/pyrfc3339/utils.pyi @@ -1,6 +1,6 @@ -from typing_extensions import Self from datetime import datetime, timedelta, tzinfo from typing import Any +from typing_extensions import Self class FixedOffset(tzinfo): def __init__(self, hours: float, minutes: float) -> None: ... diff --git a/stubs/pyasn1/pyasn1/type/univ.pyi b/stubs/pyasn1/pyasn1/type/univ.pyi index 9061b14af628..7ac15848ac0d 100644 --- a/stubs/pyasn1/pyasn1/type/univ.pyi +++ b/stubs/pyasn1/pyasn1/type/univ.pyi @@ -1,8 +1,7 @@ -from typing_extensions import Self from _typeshed import Incomplete, ReadableBuffer, SupportsRichComparison, SupportsTrunc from collections.abc import Callable, Generator from typing import SupportsInt -from typing_extensions import SupportsIndex, TypeAlias +from typing_extensions import Self, SupportsIndex, TypeAlias from pyasn1.type import base, constraint, namedtype, namedval from pyasn1.type.tag import TagSet diff --git a/stubs/pycurl/pycurl.pyi b/stubs/pycurl/pycurl.pyi index afb2586f28fc..2a531b2b602e 100644 --- a/stubs/pycurl/pycurl.pyi +++ b/stubs/pycurl/pycurl.pyi @@ -1,7 +1,6 @@ -from typing_extensions import Self import sys from _typeshed import Incomplete -from typing_extensions import final +from typing_extensions import Self, final version: str diff --git a/stubs/pyinstaller/PyInstaller/isolated/_parent.pyi b/stubs/pyinstaller/PyInstaller/isolated/_parent.pyi index c70307a26a2b..2f0b295d7315 100644 --- a/stubs/pyinstaller/PyInstaller/isolated/_parent.pyi +++ b/stubs/pyinstaller/PyInstaller/isolated/_parent.pyi @@ -1,8 +1,7 @@ -from typing_extensions import Self from collections.abc import Callable from types import TracebackType from typing import TypeVar -from typing_extensions import ParamSpec +from typing_extensions import ParamSpec, Self _AC = TypeVar("_AC", bound=Callable[..., object]) _R = TypeVar("_R") diff --git a/stubs/pynput/pynput/_util.pyi b/stubs/pynput/pynput/_util.pyi index 9631a177ed71..87788dd6da92 100644 --- a/stubs/pynput/pynput/_util.pyi +++ b/stubs/pynput/pynput/_util.pyi @@ -1,11 +1,10 @@ -from typing_extensions import Self import sys import threading from collections.abc import Callable from queue import Queue from types import ModuleType, TracebackType from typing import Any, ClassVar, Generic, TypeVar -from typing_extensions import ParamSpec, TypedDict +from typing_extensions import ParamSpec, Self, TypedDict _T = TypeVar("_T") _AbstractListener_T = TypeVar("_AbstractListener_T", bound=AbstractListener) diff --git a/stubs/pynput/pynput/keyboard/_base.pyi b/stubs/pynput/pynput/keyboard/_base.pyi index 3c82646f50a3..a67c0d0ec506 100644 --- a/stubs/pynput/pynput/keyboard/_base.pyi +++ b/stubs/pynput/pynput/keyboard/_base.pyi @@ -1,9 +1,9 @@ -from typing_extensions import Self import contextlib import enum import sys from collections.abc import Callable, Iterable, Iterator from typing import Any, ClassVar +from typing_extensions import Self from pynput._util import AbstractListener diff --git a/stubs/pynput/pynput/mouse/_base.pyi b/stubs/pynput/pynput/mouse/_base.pyi index 326f64bec4cf..409da415df22 100644 --- a/stubs/pynput/pynput/mouse/_base.pyi +++ b/stubs/pynput/pynput/mouse/_base.pyi @@ -1,9 +1,9 @@ -from typing_extensions import Self import enum import sys from collections.abc import Callable from types import TracebackType from typing import Any +from typing_extensions import Self from pynput._util import AbstractListener diff --git a/stubs/pyserial/serial/threaded/__init__.pyi b/stubs/pyserial/serial/threaded/__init__.pyi index 12216f75713c..95770e266051 100644 --- a/stubs/pyserial/serial/threaded/__init__.pyi +++ b/stubs/pyserial/serial/threaded/__init__.pyi @@ -1,7 +1,7 @@ -from typing_extensions import Self import threading from _typeshed import ReadableBuffer from collections.abc import Callable +from typing_extensions import Self from serial import Serial diff --git a/stubs/pyserial/serial/tools/miniterm.pyi b/stubs/pyserial/serial/tools/miniterm.pyi index fbc660dcf717..70b4b49e8fc8 100644 --- a/stubs/pyserial/serial/tools/miniterm.pyi +++ b/stubs/pyserial/serial/tools/miniterm.pyi @@ -1,9 +1,9 @@ -from typing_extensions import Self import codecs import sys import threading from collections.abc import Iterable from typing import Any, BinaryIO, TextIO +from typing_extensions import Self from serial import Serial diff --git a/stubs/pysftp/pysftp/__init__.pyi b/stubs/pysftp/pysftp/__init__.pyi index fc532e43c7b5..6e42892a6320 100644 --- a/stubs/pysftp/pysftp/__init__.pyi +++ b/stubs/pysftp/pysftp/__init__.pyi @@ -1,10 +1,9 @@ -from typing_extensions import Self from collections.abc import Callable, Sequence from contextlib import AbstractContextManager from stat import S_IMODE as S_IMODE from types import TracebackType from typing import IO -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias import paramiko from paramiko import AuthenticationException as AuthenticationException diff --git a/stubs/python-crontab/cronlog.pyi b/stubs/python-crontab/cronlog.pyi index 87a07ee5655b..f21d45161808 100644 --- a/stubs/python-crontab/cronlog.pyi +++ b/stubs/python-crontab/cronlog.pyi @@ -1,8 +1,8 @@ -from typing_extensions import Self from _typeshed import StrOrBytesPath from codecs import StreamReaderWriter from collections.abc import Generator, Iterator from types import TracebackType +from typing_extensions import Self MATCHER: str diff --git a/stubs/python-crontab/crontab.pyi b/stubs/python-crontab/crontab.pyi index 337fa1bdf5a0..d0335e8365a3 100644 --- a/stubs/python-crontab/crontab.pyi +++ b/stubs/python-crontab/crontab.pyi @@ -1,4 +1,3 @@ -from typing_extensions import Self import re import subprocess from _typeshed import Incomplete @@ -9,7 +8,7 @@ from datetime import datetime from logging import Logger from types import TracebackType from typing import Any -from typing_extensions import SupportsIndex, TypeAlias +from typing_extensions import Self, SupportsIndex, TypeAlias from cronlog import CronLog diff --git a/stubs/python-dateutil/dateutil/_common.pyi b/stubs/python-dateutil/dateutil/_common.pyi index cec4a11708ed..dd7eff9b63f5 100644 --- a/stubs/python-dateutil/dateutil/_common.pyi +++ b/stubs/python-dateutil/dateutil/_common.pyi @@ -1,5 +1,5 @@ - from typing_extensions import Self + class weekday: def __init__(self, weekday: int, n: int | None = ...) -> None: ... def __call__(self, n: int) -> Self: ... diff --git a/stubs/python-dateutil/dateutil/relativedelta.pyi b/stubs/python-dateutil/dateutil/relativedelta.pyi index 28be671433d0..83412d35bd7f 100644 --- a/stubs/python-dateutil/dateutil/relativedelta.pyi +++ b/stubs/python-dateutil/dateutil/relativedelta.pyi @@ -1,7 +1,6 @@ -from typing_extensions import Self from datetime import date, datetime, timedelta from typing import SupportsFloat, TypeVar, overload -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias from ._common import weekday diff --git a/stubs/python-jose/jose/backends/base.pyi b/stubs/python-jose/jose/backends/base.pyi index 87bf85617ef3..26313de27590 100644 --- a/stubs/python-jose/jose/backends/base.pyi +++ b/stubs/python-jose/jose/backends/base.pyi @@ -1,5 +1,5 @@ -from typing_extensions import Self from typing import Any +from typing_extensions import Self class Key: # Enable when we can use stubs from installed dependencies, diff --git a/stubs/python-jose/jose/backends/ecdsa_backend.pyi b/stubs/python-jose/jose/backends/ecdsa_backend.pyi index ec9489f19c63..fea488c785ad 100644 --- a/stubs/python-jose/jose/backends/ecdsa_backend.pyi +++ b/stubs/python-jose/jose/backends/ecdsa_backend.pyi @@ -1,7 +1,7 @@ -from typing_extensions import Self from collections.abc import Callable from hashlib import _Hash from typing import Any +from typing_extensions import Self from .base import Key diff --git a/stubs/python-jose/jose/backends/rsa_backend.pyi b/stubs/python-jose/jose/backends/rsa_backend.pyi index 63fb20f686b4..39e9b1715729 100644 --- a/stubs/python-jose/jose/backends/rsa_backend.pyi +++ b/stubs/python-jose/jose/backends/rsa_backend.pyi @@ -1,5 +1,5 @@ -from typing_extensions import Self from typing import Any +from typing_extensions import Self from .base import Key diff --git a/stubs/pywin32/_win32typing.pyi b/stubs/pywin32/_win32typing.pyi index 9f2c0748593b..9d730bbd483a 100644 --- a/stubs/pywin32/_win32typing.pyi +++ b/stubs/pywin32/_win32typing.pyi @@ -1,9 +1,8 @@ # Not available at runtime. Contains type definitions that are otherwise not exposed and not part of a specific module. -from typing_extensions import Self from _typeshed import Incomplete from collections.abc import Iterable from typing import overload -from typing_extensions import Literal, final +from typing_extensions import Literal, Self, final class ArgNotFound: ... class PyOleEmpty: ... diff --git a/stubs/redis/redis/asyncio/client.pyi b/stubs/redis/redis/asyncio/client.pyi index bf13b8896da1..4b8043de8b71 100644 --- a/stubs/redis/redis/asyncio/client.pyi +++ b/stubs/redis/redis/asyncio/client.pyi @@ -1,9 +1,8 @@ -from typing_extensions import Self from _typeshed import Incomplete from collections.abc import AsyncIterator, Awaitable, Callable, Iterable, Mapping, MutableMapping, Sequence from datetime import datetime, timedelta from typing import Any, ClassVar, Generic, NoReturn, Protocol, overload -from typing_extensions import Literal, TypeAlias, TypedDict +from typing_extensions import Literal, Self, TypeAlias, TypedDict from redis import RedisError from redis.asyncio.connection import ConnectCallbackT, Connection, ConnectionPool diff --git a/stubs/redis/redis/asyncio/cluster.pyi b/stubs/redis/redis/asyncio/cluster.pyi index 2bbe22410975..a5a3f5630805 100644 --- a/stubs/redis/redis/asyncio/cluster.pyi +++ b/stubs/redis/redis/asyncio/cluster.pyi @@ -1,7 +1,7 @@ -from typing_extensions import Self from _typeshed import Incomplete from collections.abc import Awaitable, Callable, Mapping from typing import Any, Generic +from typing_extensions import Self from redis.asyncio.client import ResponseCallbackT from redis.asyncio.connection import BaseParser, Connection, Encoder diff --git a/stubs/redis/redis/asyncio/lock.pyi b/stubs/redis/redis/asyncio/lock.pyi index 10ca9f210e3f..aa90042b44ae 100644 --- a/stubs/redis/redis/asyncio/lock.pyi +++ b/stubs/redis/redis/asyncio/lock.pyi @@ -1,8 +1,8 @@ -from typing_extensions import Self import threading from collections.abc import Awaitable from types import SimpleNamespace, TracebackType from typing import Any, ClassVar +from typing_extensions import Self from redis.asyncio import Redis from redis.commands.core import AsyncScript diff --git a/stubs/redis/redis/client.pyi b/stubs/redis/redis/client.pyi index 612b9bb2a496..9407a8754869 100644 --- a/stubs/redis/redis/client.pyi +++ b/stubs/redis/redis/client.pyi @@ -1,4 +1,3 @@ -from typing_extensions import Self import threading from _typeshed import Incomplete, SupportsItems from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence @@ -6,7 +5,7 @@ from datetime import datetime, timedelta from re import Pattern from types import TracebackType from typing import Any, ClassVar, Generic, TypeVar, overload -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias from redis import RedisError diff --git a/stubs/redis/redis/cluster.pyi b/stubs/redis/redis/cluster.pyi index ccfbf80bc752..a227d2fcaea0 100644 --- a/stubs/redis/redis/cluster.pyi +++ b/stubs/redis/redis/cluster.pyi @@ -1,10 +1,9 @@ -from typing_extensions import Self from _typeshed import Incomplete from collections.abc import Callable, Iterable, Sequence from threading import Lock from types import TracebackType from typing import Any, ClassVar, Generic, NoReturn, Protocol -from typing_extensions import Literal +from typing_extensions import Literal, Self from redis.client import CaseInsensitiveDict, PubSub, Redis, _ParseResponseOptions from redis.commands import CommandsParser, RedisClusterCommands diff --git a/stubs/redis/redis/connection.pyi b/stubs/redis/redis/connection.pyi index f8b431f05404..d86124909ad2 100644 --- a/stubs/redis/redis/connection.pyi +++ b/stubs/redis/redis/connection.pyi @@ -1,10 +1,9 @@ -from typing_extensions import Self from _typeshed import Incomplete from collections.abc import Callable, Iterable, Mapping from queue import Queue from socket import socket from typing import Any, ClassVar -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias from .credentials import CredentialProvider from .retry import Retry diff --git a/stubs/redis/redis/lock.pyi b/stubs/redis/redis/lock.pyi index 982f669e7c44..bb0b74183e02 100644 --- a/stubs/redis/redis/lock.pyi +++ b/stubs/redis/redis/lock.pyi @@ -1,7 +1,7 @@ -from typing_extensions import Self from _typeshed import Incomplete from types import TracebackType from typing import Any, ClassVar, Protocol +from typing_extensions import Self from redis.client import Redis diff --git a/stubs/regex/regex/_regex.pyi b/stubs/regex/regex/_regex.pyi index d55844cf104d..a8744d0d9049 100644 --- a/stubs/regex/regex/_regex.pyi +++ b/stubs/regex/regex/_regex.pyi @@ -3,9 +3,8 @@ # For example: `Pattern` and `Match` are not exported # and are redefined in `regex.regex module. -from typing_extensions import Self from typing import Any, AnyStr, Generic -from typing_extensions import final +from typing_extensions import Self, final from .regex import Match, Pattern diff --git a/stubs/regex/regex/regex.pyi b/stubs/regex/regex/regex.pyi index 34b8b925ef99..6a6d25f47cfe 100644 --- a/stubs/regex/regex/regex.pyi +++ b/stubs/regex/regex/regex.pyi @@ -1,9 +1,8 @@ -from typing_extensions import Self import sys from _typeshed import ReadableBuffer from collections.abc import Callable, Mapping from typing import Any, AnyStr, Generic, TypeVar, overload -from typing_extensions import Literal, final +from typing_extensions import Literal, Self, final from . import _regex from ._regex_core import * diff --git a/stubs/requests/requests/models.pyi b/stubs/requests/requests/models.pyi index ddfa506c6bcd..cfbca9088a2a 100644 --- a/stubs/requests/requests/models.pyi +++ b/stubs/requests/requests/models.pyi @@ -1,8 +1,8 @@ -from typing_extensions import Self import datetime from collections.abc import Callable, Iterator from json import JSONDecoder from typing import Any +from typing_extensions import Self from urllib3 import exceptions as urllib3_exceptions, fields, filepost, util diff --git a/stubs/requests/requests/sessions.pyi b/stubs/requests/requests/sessions.pyi index 25b35ad399ca..b0688d8e4406 100644 --- a/stubs/requests/requests/sessions.pyi +++ b/stubs/requests/requests/sessions.pyi @@ -1,8 +1,7 @@ -from typing_extensions import Self from _typeshed import Incomplete, SupportsItems, SupportsRead from collections.abc import Callable, Iterable, Mapping, MutableMapping from typing import Any -from typing_extensions import TypeAlias, TypedDict +from typing_extensions import Self, TypeAlias, TypedDict from urllib3._collections import RecentlyUsedContainer diff --git a/stubs/setuptools/pkg_resources/__init__.pyi b/stubs/setuptools/pkg_resources/__init__.pyi index eb9601b7567e..490184c91f89 100644 --- a/stubs/setuptools/pkg_resources/__init__.pyi +++ b/stubs/setuptools/pkg_resources/__init__.pyi @@ -1,4 +1,3 @@ -from typing_extensions import Self import importlib.abc import types import zipimport @@ -6,7 +5,7 @@ from _typeshed import Incomplete from abc import ABCMeta from collections.abc import Callable, Generator, Iterable, Sequence from typing import IO, Any, TypeVar, overload -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias _Version: TypeAlias = Incomplete # from packaging.version diff --git a/stubs/setuptools/setuptools/_distutils/version.pyi b/stubs/setuptools/setuptools/_distutils/version.pyi index 23c6bbbacf0a..b6662d04f02f 100644 --- a/stubs/setuptools/setuptools/_distutils/version.pyi +++ b/stubs/setuptools/setuptools/_distutils/version.pyi @@ -1,5 +1,5 @@ -from typing_extensions import Self from re import Pattern +from typing_extensions import Self class Version: def __init__(self, vstring: str | None = ...) -> None: ... diff --git a/stubs/setuptools/setuptools/command/test.pyi b/stubs/setuptools/setuptools/command/test.pyi index bfaa842640ec..0ee33879b6c8 100644 --- a/stubs/setuptools/setuptools/command/test.pyi +++ b/stubs/setuptools/setuptools/command/test.pyi @@ -1,8 +1,8 @@ -from typing_extensions import Self from _typeshed import Incomplete from collections.abc import Callable from types import ModuleType from typing import Any, Generic, TypeVar, overload +from typing_extensions import Self from unittest import TestLoader, TestSuite from setuptools import Command diff --git a/stubs/slumber/slumber/__init__.pyi b/stubs/slumber/slumber/__init__.pyi index 3b72a5a4b28e..f35d7855ed00 100644 --- a/stubs/slumber/slumber/__init__.pyi +++ b/stubs/slumber/slumber/__init__.pyi @@ -1,5 +1,5 @@ -from typing_extensions import Self from typing import Any +from typing_extensions import Self from requests import Response, Session from requests.sessions import _Auth, _Data, _Files diff --git a/stubs/stripe/stripe/api_resources/abstract/api_resource.pyi b/stubs/stripe/stripe/api_resources/abstract/api_resource.pyi index 9eb351bcf5ed..8891f1133801 100644 --- a/stubs/stripe/stripe/api_resources/abstract/api_resource.pyi +++ b/stubs/stripe/stripe/api_resources/abstract/api_resource.pyi @@ -1,5 +1,5 @@ -from typing_extensions import Self from _typeshed import Incomplete +from typing_extensions import Self from stripe import api_requestor as api_requestor, error as error from stripe.stripe_object import StripeObject as StripeObject diff --git a/stubs/stripe/stripe/api_resources/abstract/createable_api_resource.pyi b/stubs/stripe/stripe/api_resources/abstract/createable_api_resource.pyi index dd3e690ae269..1191ea7ff600 100644 --- a/stubs/stripe/stripe/api_resources/abstract/createable_api_resource.pyi +++ b/stubs/stripe/stripe/api_resources/abstract/createable_api_resource.pyi @@ -1,5 +1,5 @@ -from typing_extensions import Self from _typeshed import Incomplete +from typing_extensions import Self from stripe import api_requestor as api_requestor from stripe.api_resources.abstract.api_resource import APIResource as APIResource diff --git a/stubs/stripe/stripe/api_resources/abstract/deletable_api_resource.pyi b/stubs/stripe/stripe/api_resources/abstract/deletable_api_resource.pyi index 484a37382105..b82f72b7b91f 100644 --- a/stubs/stripe/stripe/api_resources/abstract/deletable_api_resource.pyi +++ b/stubs/stripe/stripe/api_resources/abstract/deletable_api_resource.pyi @@ -1,5 +1,5 @@ - from typing_extensions import Self + from stripe.api_resources.abstract.api_resource import APIResource as APIResource class DeletableAPIResource(APIResource): diff --git a/stubs/stripe/stripe/api_resources/abstract/searchable_api_resource.pyi b/stubs/stripe/stripe/api_resources/abstract/searchable_api_resource.pyi index beec4b4f51c3..cf683861319e 100644 --- a/stubs/stripe/stripe/api_resources/abstract/searchable_api_resource.pyi +++ b/stubs/stripe/stripe/api_resources/abstract/searchable_api_resource.pyi @@ -1,5 +1,5 @@ -from typing_extensions import Self from collections.abc import Iterator +from typing_extensions import Self from stripe.api_resources.abstract.api_resource import APIResource as APIResource from stripe.api_resources.search_result_object import SearchResultObject diff --git a/stubs/stripe/stripe/api_resources/abstract/updateable_api_resource.pyi b/stubs/stripe/stripe/api_resources/abstract/updateable_api_resource.pyi index fb88d5affe45..ffbcbb141a65 100644 --- a/stubs/stripe/stripe/api_resources/abstract/updateable_api_resource.pyi +++ b/stubs/stripe/stripe/api_resources/abstract/updateable_api_resource.pyi @@ -1,5 +1,5 @@ - from typing_extensions import Self + from stripe.api_resources.abstract.api_resource import APIResource as APIResource class UpdateableAPIResource(APIResource): diff --git a/stubs/stripe/stripe/api_resources/application_fee_refund.pyi b/stubs/stripe/stripe/api_resources/application_fee_refund.pyi index 60537e6622ef..865bb0fc9ed9 100644 --- a/stubs/stripe/stripe/api_resources/application_fee_refund.pyi +++ b/stubs/stripe/stripe/api_resources/application_fee_refund.pyi @@ -1,6 +1,6 @@ -from typing_extensions import Self from _typeshed import Incomplete from typing import NoReturn +from typing_extensions import Self from stripe.api_resources import ApplicationFee as ApplicationFee from stripe.api_resources.abstract import UpdateableAPIResource as UpdateableAPIResource diff --git a/stubs/stripe/stripe/api_resources/invoice.pyi b/stubs/stripe/stripe/api_resources/invoice.pyi index 5ad93c27dda5..50d8c9f312a8 100644 --- a/stubs/stripe/stripe/api_resources/invoice.pyi +++ b/stubs/stripe/stripe/api_resources/invoice.pyi @@ -1,5 +1,5 @@ -from typing_extensions import Self from _typeshed import Incomplete +from typing_extensions import Self from stripe import api_requestor as api_requestor from stripe.api_resources.abstract import ( diff --git a/stubs/stripe/stripe/api_resources/payment_method.pyi b/stubs/stripe/stripe/api_resources/payment_method.pyi index 5db83f3398ef..47310ad782b6 100644 --- a/stubs/stripe/stripe/api_resources/payment_method.pyi +++ b/stubs/stripe/stripe/api_resources/payment_method.pyi @@ -1,5 +1,5 @@ - from typing_extensions import Self + from stripe.api_resources.abstract import ( CreateableAPIResource as CreateableAPIResource, ListableAPIResource as ListableAPIResource, diff --git a/stubs/stripe/stripe/api_resources/search_result_object.pyi b/stubs/stripe/stripe/api_resources/search_result_object.pyi index 643333f01e94..e447b5824575 100644 --- a/stubs/stripe/stripe/api_resources/search_result_object.pyi +++ b/stubs/stripe/stripe/api_resources/search_result_object.pyi @@ -1,7 +1,6 @@ -from typing_extensions import Self from collections.abc import Iterator from typing import Any, ClassVar, Generic, TypeVar -from typing_extensions import Literal +from typing_extensions import Literal, Self from stripe.stripe_object import StripeObject diff --git a/stubs/stripe/stripe/api_resources/test_helpers/test_clock.pyi b/stubs/stripe/stripe/api_resources/test_helpers/test_clock.pyi index eaeab8110f85..3caf15ecc1ac 100644 --- a/stubs/stripe/stripe/api_resources/test_helpers/test_clock.pyi +++ b/stubs/stripe/stripe/api_resources/test_helpers/test_clock.pyi @@ -1,6 +1,5 @@ -from typing_extensions import Self from typing import Any -from typing_extensions import Literal +from typing_extensions import Literal, Self from stripe.api_resources.abstract import CreateableAPIResource, DeletableAPIResource, ListableAPIResource diff --git a/stubs/stripe/stripe/stripe_object.pyi b/stubs/stripe/stripe/stripe_object.pyi index d172859e2b8b..cfb021b26aaa 100644 --- a/stubs/stripe/stripe/stripe_object.pyi +++ b/stubs/stripe/stripe/stripe_object.pyi @@ -1,7 +1,7 @@ -from typing_extensions import Self import json from _typeshed import Incomplete from typing import Any +from typing_extensions import Self from stripe import api_requestor as api_requestor diff --git a/stubs/tensorflow/tensorflow/__init__.pyi b/stubs/tensorflow/tensorflow/__init__.pyi index e3709bc20f1f..c6d0ba98d265 100644 --- a/stubs/tensorflow/tensorflow/__init__.pyi +++ b/stubs/tensorflow/tensorflow/__init__.pyi @@ -1,4 +1,3 @@ -from typing_extensions import Self from _typeshed import Incomplete, Unused from abc import ABCMeta from builtins import bool as _bool @@ -6,7 +5,7 @@ from collections.abc import Callable, Iterable, Iterator, Sequence from contextlib import contextmanager from enum import Enum from typing import Any, NoReturn, overload -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias import numpy diff --git a/stubs/toml/toml/tz.pyi b/stubs/toml/toml/tz.pyi index c4c96adcbe02..054226bf76d4 100644 --- a/stubs/toml/toml/tz.pyi +++ b/stubs/toml/toml/tz.pyi @@ -1,6 +1,6 @@ -from typing_extensions import Self from datetime import datetime, timedelta, tzinfo from typing import Any +from typing_extensions import Self class TomlTz(tzinfo): def __init__(self, toml_offset: str) -> None: ... diff --git a/stubs/tqdm/tqdm/asyncio.pyi b/stubs/tqdm/tqdm/asyncio.pyi index 7d53ddff7081..488fadbfe1a6 100644 --- a/stubs/tqdm/tqdm/asyncio.pyi +++ b/stubs/tqdm/tqdm/asyncio.pyi @@ -1,7 +1,7 @@ -from typing_extensions import Self from _typeshed import Incomplete, SupportsWrite from collections.abc import Awaitable, Callable, Generator, Iterable, Iterator, Mapping from typing import Generic, NoReturn, TypeVar, overload +from typing_extensions import Self from .std import tqdm as std_tqdm diff --git a/stubs/tqdm/tqdm/dask.pyi b/stubs/tqdm/tqdm/dask.pyi index 73293250b31b..5e55eadb802c 100644 --- a/stubs/tqdm/tqdm/dask.pyi +++ b/stubs/tqdm/tqdm/dask.pyi @@ -1,7 +1,7 @@ -from typing_extensions import Self from _typeshed import Incomplete from collections.abc import Callable from typing import ClassVar +from typing_extensions import Self __all__ = ["TqdmCallback"] diff --git a/stubs/tqdm/tqdm/std.pyi b/stubs/tqdm/tqdm/std.pyi index 42ecf643d588..a5dc22b3d4c6 100644 --- a/stubs/tqdm/tqdm/std.pyi +++ b/stubs/tqdm/tqdm/std.pyi @@ -1,9 +1,8 @@ -from typing_extensions import Self import contextlib from _typeshed import Incomplete, SupportsWrite from collections.abc import Callable, Iterable, Iterator, Mapping, MutableMapping from typing import Any, ClassVar, Generic, NoReturn, TypeVar, overload -from typing_extensions import Literal +from typing_extensions import Literal, Self from ._monitor import TMonitor from .utils import Comparable diff --git a/stubs/untangle/untangle.pyi b/stubs/untangle/untangle.pyi index ef2121fecf5a..f706aee02c94 100644 --- a/stubs/untangle/untangle.pyi +++ b/stubs/untangle/untangle.pyi @@ -1,6 +1,6 @@ -from typing_extensions import Self from collections.abc import Iterator, Mapping from typing import Any +from typing_extensions import Self from xml.sax import handler def is_string(x: object) -> bool: ... diff --git a/stubs/urllib3/urllib3/connectionpool.pyi b/stubs/urllib3/urllib3/connectionpool.pyi index 6f673eb40eb5..4d27996de248 100644 --- a/stubs/urllib3/urllib3/connectionpool.pyi +++ b/stubs/urllib3/urllib3/connectionpool.pyi @@ -1,10 +1,9 @@ -from typing_extensions import Self import queue from collections.abc import Mapping from logging import Logger from types import TracebackType from typing import Any, ClassVar -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias from . import connection, exceptions, request, response from .connection import BaseSSLError as BaseSSLError, ConnectionError as ConnectionError, HTTPException as HTTPException diff --git a/stubs/urllib3/urllib3/response.pyi b/stubs/urllib3/urllib3/response.pyi index bc99aeb6b181..a4f76d312fbc 100644 --- a/stubs/urllib3/urllib3/response.pyi +++ b/stubs/urllib3/urllib3/response.pyi @@ -1,9 +1,8 @@ -from typing_extensions import Self import io from collections.abc import Iterable, Iterator, Mapping from http.client import HTTPMessage as _HttplibHTTPMessage, HTTPResponse as _HttplibHTTPResponse from typing import IO, Any -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias from urllib3.connectionpool import HTTPConnection diff --git a/stubs/urllib3/urllib3/util/retry.pyi b/stubs/urllib3/urllib3/util/retry.pyi index e29765b0c51c..8fdb97685e79 100644 --- a/stubs/urllib3/urllib3/util/retry.pyi +++ b/stubs/urllib3/urllib3/util/retry.pyi @@ -1,9 +1,8 @@ -from typing_extensions import Self import logging from collections.abc import Collection from types import TracebackType from typing import Any, ClassVar, NamedTuple -from typing_extensions import Literal +from typing_extensions import Literal, Self from .. import exceptions from ..connectionpool import ConnectionPool From ffce33e9435bd7fccb22176b18001dc0116ba4aa Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Thu, 9 Feb 2023 16:45:44 +0000 Subject: [PATCH 4/7] Manual changes to `python-dateutil` --- stubs/python-dateutil/dateutil/relativedelta.pyi | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/stubs/python-dateutil/dateutil/relativedelta.pyi b/stubs/python-dateutil/dateutil/relativedelta.pyi index 83412d35bd7f..d0e0bd7eccf7 100644 --- a/stubs/python-dateutil/dateutil/relativedelta.pyi +++ b/stubs/python-dateutil/dateutil/relativedelta.pyi @@ -4,8 +4,6 @@ from typing_extensions import Self, TypeAlias from ._common import weekday -# We need the extra "Self" TypeVar to avoid overlapping __add__/__radd__ complaints from mypy -_SelfT = TypeVar("_SelfT", bound=relativedelta) _DateT = TypeVar("_DateT", date, datetime) # Work around attribute and type having the same name. _Weekday: TypeAlias = weekday @@ -67,15 +65,15 @@ class relativedelta: # TODO: use Union when mypy will handle it properly in overloaded operator # methods (#2129, #1442, #1264 in mypy) @overload - def __add__(self: _SelfT, other: relativedelta) -> _SelfT: ... # noqa: Y019 + def __add__(self, other: relativedelta) -> Self: ... @overload - def __add__(self: _SelfT, other: timedelta) -> _SelfT: ... # noqa: Y019 + def __add__(self, other: timedelta) -> Self: ... @overload def __add__(self, other: _DateT) -> _DateT: ... @overload - def __radd__(self: _SelfT, other: relativedelta) -> _SelfT: ... # noqa: Y019 + def __radd__(self, other: relativedelta) -> Self: ... @overload - def __radd__(self: _SelfT, other: timedelta) -> _SelfT: ... # noqa: Y019 + def __radd__(self, other: timedelta) -> Self: ... @overload def __radd__(self, other: _DateT) -> _DateT: ... @overload From 2166801fa0b31d0124ef6a37abec45c6f31c015c Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Thu, 9 Feb 2023 16:58:14 +0000 Subject: [PATCH 5/7] Remove unused ignores --- stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi b/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi index 7cbd0588c46b..432e6e1dc756 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi @@ -88,11 +88,11 @@ class OrderedSet(set[_T], Generic[_T]): def union(self, other: Iterable[_S]) -> OrderedSet[_S | _T]: ... # type: ignore[override] __or__ = union # type: ignore[assignment] # pyright: ignore[reportGeneralTypeIssues] def intersection(self, other: Iterable[Any]) -> Self: ... # type: ignore[override] - __and__ = intersection # type: ignore[assignment] # pyright: ignore[reportGeneralTypeIssues] + __and__ = intersection def symmetric_difference(self, other: Iterable[_S]) -> OrderedSet[_S | _T]: ... __xor__ = symmetric_difference # type: ignore[assignment] # pyright: ignore[reportGeneralTypeIssues] def difference(self, other: Iterable[Any]) -> Self: ... # type: ignore[override] - __sub__ = difference # type: ignore[assignment] # pyright: ignore[reportGeneralTypeIssues] + __sub__ = difference def intersection_update(self, other: Iterable[Any]) -> Self: ... # type: ignore[override] __iand__ = intersection_update # type: ignore[assignment] def symmetric_difference_update(self, other: Iterable[_T]) -> Self: ... # type: ignore[override] From 7fc50c6cf2fd2226f0d8c6b957d6617195eb76ba Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Thu, 9 Feb 2023 17:59:24 +0000 Subject: [PATCH 6/7] Revert changes to `stubs/pika` to workaround the pyright bug --- .../pika/pika/adapters/asyncio_connection.pyi | 5 ++--- stubs/pika/pika/adapters/base_connection.pyi | 5 ++--- .../pika/pika/adapters/blocking_connection.pyi | 5 ++--- stubs/pika/pika/channel.pyi | 6 +++--- stubs/pika/pika/connection.pyi | 18 ++++++++++-------- stubs/pika/pika/spec.pyi | 10 +++++----- 6 files changed, 24 insertions(+), 25 deletions(-) diff --git a/stubs/pika/pika/adapters/asyncio_connection.pyi b/stubs/pika/pika/adapters/asyncio_connection.pyi index 621eb6fa2743..57a3257cd565 100644 --- a/stubs/pika/pika/adapters/asyncio_connection.pyi +++ b/stubs/pika/pika/adapters/asyncio_connection.pyi @@ -1,8 +1,7 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, Self from asyncio import AbstractEventLoop from collections.abc import Callable from logging import Logger -from typing_extensions import Self from ..connection import Parameters from .base_connection import BaseConnection @@ -12,7 +11,7 @@ LOGGER: Logger class AsyncioConnection(BaseConnection): def __init__( - self, + self: Self, parameters: Parameters | None = ..., on_open_callback: Callable[[Self], object] | None = ..., on_open_error_callback: Callable[[Self, BaseException], object] | None = ..., diff --git a/stubs/pika/pika/adapters/base_connection.pyi b/stubs/pika/pika/adapters/base_connection.pyi index db129fa75c6b..3cf7ed97f354 100644 --- a/stubs/pika/pika/adapters/base_connection.pyi +++ b/stubs/pika/pika/adapters/base_connection.pyi @@ -1,7 +1,6 @@ import abc -from _typeshed import Incomplete +from _typeshed import Incomplete, Self from collections.abc import Callable -from typing_extensions import Self from ..adapters.utils import nbio_interface from ..connection import Connection @@ -10,7 +9,7 @@ LOGGER: Incomplete class BaseConnection(Connection, metaclass=abc.ABCMeta): def __init__( - self, + self: Self, parameters, on_open_callback: Callable[[Self], object] | None, on_open_error_callback: Callable[[Self, BaseException], object] | None, diff --git a/stubs/pika/pika/adapters/blocking_connection.pyi b/stubs/pika/pika/adapters/blocking_connection.pyi index 5f330829c7a9..c0907f2f37d9 100644 --- a/stubs/pika/pika/adapters/blocking_connection.pyi +++ b/stubs/pika/pika/adapters/blocking_connection.pyi @@ -1,7 +1,6 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, Self from collections.abc import Generator, Sequence from typing import NamedTuple -from typing_extensions import Self from ..connection import Parameters from ..data import _ArgumentMapping @@ -56,7 +55,7 @@ class BlockingConnection: def __init__( self, parameters: Parameters | Sequence[Parameters] | None = ..., _impl_class: Incomplete | None = ... ) -> None: ... - def __enter__(self) -> Self: ... + def __enter__(self: Self) -> Self: ... def __exit__(self, exc_type: object, value: object, traceback: object) -> None: ... def add_on_connection_blocked_callback(self, callback) -> None: ... def add_on_connection_unblocked_callback(self, callback) -> None: ... diff --git a/stubs/pika/pika/channel.pyi b/stubs/pika/pika/channel.pyi index 3f28e847c17f..30631f00fdaa 100644 --- a/stubs/pika/pika/channel.pyi +++ b/stubs/pika/pika/channel.pyi @@ -1,8 +1,8 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, Self from collections.abc import Callable from logging import Logger from typing import Any -from typing_extensions import Final, Self +from typing_extensions import Final from .callback import CallbackManager from .connection import Connection @@ -25,7 +25,7 @@ class Channel: connection: Connection flow_active: bool - def __init__(self, connection: Connection, channel_number: int, on_open_callback: Callable[[Self], object]) -> None: ... + def __init__(self: Self, connection: Connection, channel_number: int, on_open_callback: Callable[[Self], object]) -> None: ... def __int__(self) -> int: ... def add_callback(self, callback, replies, one_shot: bool = ...) -> None: ... def add_on_cancel_callback(self, callback) -> None: ... diff --git a/stubs/pika/pika/connection.pyi b/stubs/pika/pika/connection.pyi index 21024b427b72..97a10c698fa8 100644 --- a/stubs/pika/pika/connection.pyi +++ b/stubs/pika/pika/connection.pyi @@ -1,8 +1,8 @@ import abc -from _typeshed import Incomplete +from _typeshed import Incomplete, Self from collections.abc import Callable from logging import Logger -from typing_extensions import Final, Self +from typing_extensions import Final from .callback import CallbackManager from .channel import Channel @@ -150,21 +150,23 @@ class Connection(AbstractBase, metaclass=abc.ABCMeta): server_properties: Incomplete known_hosts: Incomplete def __init__( - self, + self: Self, parameters: Parameters | None = ..., on_open_callback: Callable[[Self], object] | None = ..., on_open_error_callback: Callable[[Self, BaseException], object] | None = ..., on_close_callback: Callable[[Self, BaseException], object] | None = ..., internal_connection_workflow: bool = ..., ) -> None: ... - def add_on_close_callback(self, callback: Callable[[Self, BaseException], object]) -> None: ... - def add_on_connection_blocked_callback(self, callback: Callable[[Self, Method[SpecConnection.Blocked]], object]) -> None: ... + def add_on_close_callback(self: Self, callback: Callable[[Self, BaseException], object]) -> None: ... + def add_on_connection_blocked_callback( + self: Self, callback: Callable[[Self, Method[SpecConnection.Blocked]], object] + ) -> None: ... def add_on_connection_unblocked_callback( - self, callback: Callable[[Self, Method[SpecConnection.Unblocked]], object] + self: Self, callback: Callable[[Self, Method[SpecConnection.Unblocked]], object] ) -> None: ... - def add_on_open_callback(self, callback: Callable[[Self], object]) -> None: ... + def add_on_open_callback(self: Self, callback: Callable[[Self], object]) -> None: ... def add_on_open_error_callback( - self, callback: Callable[[Self, BaseException], object], remove_default: bool = ... + self: Self, callback: Callable[[Self, BaseException], object], remove_default: bool = ... ) -> None: ... def channel( self, channel_number: int | None = ..., on_open_callback: Callable[[Channel], object] | None = ... diff --git a/stubs/pika/pika/spec.pyi b/stubs/pika/pika/spec.pyi index c213867c06e6..d0b6bf1227c8 100644 --- a/stubs/pika/pika/spec.pyi +++ b/stubs/pika/pika/spec.pyi @@ -1,6 +1,6 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, Self from typing import ClassVar -from typing_extensions import Literal, Self, TypeAlias +from typing_extensions import Literal, TypeAlias from .amqp_object import Class, Method, Properties @@ -339,7 +339,7 @@ class Exchange(Class): def __init__(self) -> None: ... @property def synchronous(self) -> Literal[False]: ... - def decode(self, encoded: bytes, offset: int = ...) -> Self: ... + def decode(self: Self, encoded: bytes, offset: int = ...) -> Self: ... def encode(self) -> list[bytes]: ... class Delete(Method): @@ -450,7 +450,7 @@ class Queue(Class): ) -> None: ... @property def synchronous(self) -> Literal[True]: ... - def decode(self, encoded: bytes, offset: int = ...) -> Self: ... + def decode(self: Self, encoded: bytes, offset: int = ...) -> Self: ... def encode(self) -> list[bytes]: ... class DeclareOk(Method): @@ -461,7 +461,7 @@ class Queue(Class): def __init__(self, queue: _str, message_count: int, consumer_count: int) -> None: ... @property def synchronous(self) -> Literal[False]: ... - def decode(self, encoded: bytes, offset: int = ...) -> Self: ... + def decode(self: Self, encoded: bytes, offset: int = ...) -> Self: ... def encode(self) -> list[bytes]: ... class Bind(Method): From 73c5bf744b9e73ab5127c53fb72c7118aded0e74 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Wed, 15 Feb 2023 11:15:35 +0100 Subject: [PATCH 7/7] Revert "Revert changes to `stubs/pika` to workaround the pyright bug" This reverts commit 7fc50c6cf2fd2226f0d8c6b957d6617195eb76ba. --- .../pika/pika/adapters/asyncio_connection.pyi | 5 +++-- stubs/pika/pika/adapters/base_connection.pyi | 5 +++-- .../pika/pika/adapters/blocking_connection.pyi | 5 +++-- stubs/pika/pika/channel.pyi | 6 +++--- stubs/pika/pika/connection.pyi | 18 ++++++++---------- stubs/pika/pika/spec.pyi | 10 +++++----- 6 files changed, 25 insertions(+), 24 deletions(-) diff --git a/stubs/pika/pika/adapters/asyncio_connection.pyi b/stubs/pika/pika/adapters/asyncio_connection.pyi index 57a3257cd565..621eb6fa2743 100644 --- a/stubs/pika/pika/adapters/asyncio_connection.pyi +++ b/stubs/pika/pika/adapters/asyncio_connection.pyi @@ -1,7 +1,8 @@ -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from asyncio import AbstractEventLoop from collections.abc import Callable from logging import Logger +from typing_extensions import Self from ..connection import Parameters from .base_connection import BaseConnection @@ -11,7 +12,7 @@ LOGGER: Logger class AsyncioConnection(BaseConnection): def __init__( - self: Self, + self, parameters: Parameters | None = ..., on_open_callback: Callable[[Self], object] | None = ..., on_open_error_callback: Callable[[Self, BaseException], object] | None = ..., diff --git a/stubs/pika/pika/adapters/base_connection.pyi b/stubs/pika/pika/adapters/base_connection.pyi index 3cf7ed97f354..db129fa75c6b 100644 --- a/stubs/pika/pika/adapters/base_connection.pyi +++ b/stubs/pika/pika/adapters/base_connection.pyi @@ -1,6 +1,7 @@ import abc -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from collections.abc import Callable +from typing_extensions import Self from ..adapters.utils import nbio_interface from ..connection import Connection @@ -9,7 +10,7 @@ LOGGER: Incomplete class BaseConnection(Connection, metaclass=abc.ABCMeta): def __init__( - self: Self, + self, parameters, on_open_callback: Callable[[Self], object] | None, on_open_error_callback: Callable[[Self, BaseException], object] | None, diff --git a/stubs/pika/pika/adapters/blocking_connection.pyi b/stubs/pika/pika/adapters/blocking_connection.pyi index c0907f2f37d9..5f330829c7a9 100644 --- a/stubs/pika/pika/adapters/blocking_connection.pyi +++ b/stubs/pika/pika/adapters/blocking_connection.pyi @@ -1,6 +1,7 @@ -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from collections.abc import Generator, Sequence from typing import NamedTuple +from typing_extensions import Self from ..connection import Parameters from ..data import _ArgumentMapping @@ -55,7 +56,7 @@ class BlockingConnection: def __init__( self, parameters: Parameters | Sequence[Parameters] | None = ..., _impl_class: Incomplete | None = ... ) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, exc_type: object, value: object, traceback: object) -> None: ... def add_on_connection_blocked_callback(self, callback) -> None: ... def add_on_connection_unblocked_callback(self, callback) -> None: ... diff --git a/stubs/pika/pika/channel.pyi b/stubs/pika/pika/channel.pyi index 30631f00fdaa..3f28e847c17f 100644 --- a/stubs/pika/pika/channel.pyi +++ b/stubs/pika/pika/channel.pyi @@ -1,8 +1,8 @@ -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from collections.abc import Callable from logging import Logger from typing import Any -from typing_extensions import Final +from typing_extensions import Final, Self from .callback import CallbackManager from .connection import Connection @@ -25,7 +25,7 @@ class Channel: connection: Connection flow_active: bool - def __init__(self: Self, connection: Connection, channel_number: int, on_open_callback: Callable[[Self], object]) -> None: ... + def __init__(self, connection: Connection, channel_number: int, on_open_callback: Callable[[Self], object]) -> None: ... def __int__(self) -> int: ... def add_callback(self, callback, replies, one_shot: bool = ...) -> None: ... def add_on_cancel_callback(self, callback) -> None: ... diff --git a/stubs/pika/pika/connection.pyi b/stubs/pika/pika/connection.pyi index 97a10c698fa8..21024b427b72 100644 --- a/stubs/pika/pika/connection.pyi +++ b/stubs/pika/pika/connection.pyi @@ -1,8 +1,8 @@ import abc -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from collections.abc import Callable from logging import Logger -from typing_extensions import Final +from typing_extensions import Final, Self from .callback import CallbackManager from .channel import Channel @@ -150,23 +150,21 @@ class Connection(AbstractBase, metaclass=abc.ABCMeta): server_properties: Incomplete known_hosts: Incomplete def __init__( - self: Self, + self, parameters: Parameters | None = ..., on_open_callback: Callable[[Self], object] | None = ..., on_open_error_callback: Callable[[Self, BaseException], object] | None = ..., on_close_callback: Callable[[Self, BaseException], object] | None = ..., internal_connection_workflow: bool = ..., ) -> None: ... - def add_on_close_callback(self: Self, callback: Callable[[Self, BaseException], object]) -> None: ... - def add_on_connection_blocked_callback( - self: Self, callback: Callable[[Self, Method[SpecConnection.Blocked]], object] - ) -> None: ... + def add_on_close_callback(self, callback: Callable[[Self, BaseException], object]) -> None: ... + def add_on_connection_blocked_callback(self, callback: Callable[[Self, Method[SpecConnection.Blocked]], object]) -> None: ... def add_on_connection_unblocked_callback( - self: Self, callback: Callable[[Self, Method[SpecConnection.Unblocked]], object] + self, callback: Callable[[Self, Method[SpecConnection.Unblocked]], object] ) -> None: ... - def add_on_open_callback(self: Self, callback: Callable[[Self], object]) -> None: ... + def add_on_open_callback(self, callback: Callable[[Self], object]) -> None: ... def add_on_open_error_callback( - self: Self, callback: Callable[[Self, BaseException], object], remove_default: bool = ... + self, callback: Callable[[Self, BaseException], object], remove_default: bool = ... ) -> None: ... def channel( self, channel_number: int | None = ..., on_open_callback: Callable[[Channel], object] | None = ... diff --git a/stubs/pika/pika/spec.pyi b/stubs/pika/pika/spec.pyi index d0b6bf1227c8..c213867c06e6 100644 --- a/stubs/pika/pika/spec.pyi +++ b/stubs/pika/pika/spec.pyi @@ -1,6 +1,6 @@ -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from typing import ClassVar -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias from .amqp_object import Class, Method, Properties @@ -339,7 +339,7 @@ class Exchange(Class): def __init__(self) -> None: ... @property def synchronous(self) -> Literal[False]: ... - def decode(self: Self, encoded: bytes, offset: int = ...) -> Self: ... + def decode(self, encoded: bytes, offset: int = ...) -> Self: ... def encode(self) -> list[bytes]: ... class Delete(Method): @@ -450,7 +450,7 @@ class Queue(Class): ) -> None: ... @property def synchronous(self) -> Literal[True]: ... - def decode(self: Self, encoded: bytes, offset: int = ...) -> Self: ... + def decode(self, encoded: bytes, offset: int = ...) -> Self: ... def encode(self) -> list[bytes]: ... class DeclareOk(Method): @@ -461,7 +461,7 @@ class Queue(Class): def __init__(self, queue: _str, message_count: int, consumer_count: int) -> None: ... @property def synchronous(self) -> Literal[False]: ... - def decode(self: Self, encoded: bytes, offset: int = ...) -> Self: ... + def decode(self, encoded: bytes, offset: int = ...) -> Self: ... def encode(self) -> list[bytes]: ... class Bind(Method):