mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
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:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user