Remove Generic from sqlite3.Row (#8036)

Introduced in https://github.com/python/typeshed/pull/7641.  Removal discussed at https://github.com/python/typeshed/issues/8027.
This commit is contained in:
Kyle Altendorf
2022-06-11 09:53:22 -04:00
committed by GitHub
parent b4c3e2c3e1
commit a750a42c65

View File

@@ -4,11 +4,10 @@ from _typeshed import ReadableBuffer, Self, StrOrBytesPath, SupportsLenAndGetIte
from collections.abc import Callable, Generator, Iterable, Iterator, Mapping
from datetime import date, datetime, time
from types import TracebackType
from typing import Any, Generic, Protocol, TypeVar, overload
from typing import Any, Protocol, TypeVar, overload
from typing_extensions import Literal, SupportsIndex, TypeAlias, final
_T = TypeVar("_T")
_T_co = TypeVar("_T_co", covariant=True)
_CursorT = TypeVar("_CursorT", bound=Cursor)
_SqliteData: TypeAlias = str | ReadableBuffer | int | float | None
# Data that is passed through adapters can be of any type accepted by an adapter.
@@ -379,7 +378,7 @@ class Cursor(Iterator[Any]):
def description(self) -> tuple[tuple[str, None, None, None, None, None, None], ...] | Any: ...
@property
def lastrowid(self) -> int | None: ...
row_factory: Callable[[Cursor, Row[Any]], object] | None
row_factory: Callable[[Cursor, Row], object] | None
@property
def rowcount(self) -> int: ...
def __init__(self, __cursor: Connection) -> None: ...
@@ -420,15 +419,15 @@ class PrepareProtocol:
class ProgrammingError(DatabaseError): ...
class Row(Generic[_T_co]):
def __init__(self, __cursor: Cursor, __data: tuple[_T_co, ...]) -> None: ...
class Row:
def __init__(self, __cursor: Cursor, __data: tuple[Any, ...]) -> None: ...
def keys(self) -> list[str]: ...
@overload
def __getitem__(self, __index: int | str) -> _T_co: ...
def __getitem__(self, __index: int | str) -> Any: ...
@overload
def __getitem__(self, __index: slice) -> tuple[_T_co, ...]: ...
def __getitem__(self, __index: slice) -> tuple[Any, ...]: ...
def __hash__(self) -> int: ...
def __iter__(self) -> Iterator[_T_co]: ...
def __iter__(self) -> Iterator[Any]: ...
def __len__(self) -> int: ...
# These return NotImplemented for anything that is not a Row.
def __eq__(self, __other: object) -> bool: ...