Use typing_extensions.Self instead of _typeshed.Self (#9702)

This commit is contained in:
Alex Waygood
2023-02-15 11:32:43 +01:00
committed by GitHub
parent 8cd6d81f15
commit 7180d0223b
140 changed files with 597 additions and 610 deletions

View File

@@ -1,7 +1,8 @@
from _typeshed import Incomplete, 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
@@ -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

View File

@@ -1,6 +1,6 @@
from _typeshed import Self
from collections.abc import Iterable, Iterator
from typing import Any
from typing_extensions import Self
from .connections import Connection
@@ -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: ...