8000 Remove Generic from sqlite3.Row (#8036) · python/typeshed@a750a42 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a750a42

Browse files
authored
Remove Generic from sqlite3.Row (#8036)
Introduced in #7641. Removal discussed at #8027.
1 parent b4c3e2c commit a750a42

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

stdlib/sqlite3/dbapi2.pyi

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ from _typeshed import ReadableBuffer, Self, StrOrBytesPath, SupportsLenAndGetIte
44
from collections.abc import Callable, Generator, Iterable, Iterator, Mapping
55
from datetime import date, datetime, time
66
from types import TracebackType
7-
from typing import Any, Generic, Protocol, TypeVar, overload
7+
from typing import Any, Protocol, TypeVar, overload
88
from typing_extensions import Literal, SupportsIndex, TypeAlias, final
99

1010
_T = TypeVar("_T")
11-
_T_co = TypeVar("_T_co", covariant=True)
1211
_CursorT = TypeVar("_CursorT", bound=Cursor)
1312
_SqliteData: TypeAlias = str | ReadableBuffer | int | float | None
1413
# Data that is passed through adapters can be of any type accepted by an adapter.
@@ -379,7 +378,7 @@ class Cursor(Iterator[Any]):
379378
def description(self) -> tuple[tuple[str, None, None, None, None, None, None], ...] | Any: ...
380379
@property
381380
def lastrowid(self) -> int | None: ...
382-
row_factory: Callable[[Cursor, Row[Any]], object] | None
381+
row_factory: Callable[[Cursor, Row], object] | None
383382
@property
384383
def rowcount(self) -> int: ...
385384
def __init__(self, __cursor: Connection) -> None: ...
@@ -420,15 +419,15 @@ class PrepareProtocol:
420419

421420
class ProgrammingError(DatabaseError): ...
422421

423-
class Row(Generic[_T_co]):
424-
def __init__(self, __cursor: Cursor, __data: tuple[_T_co, ...]) -> None: ...
422+
class Row:
423+
def __init__(self, __cursor: Cursor, __data: tuple[Any, ...]) -> None: ...
425424
def keys(self) -> list[str]: ...
426425
@overload
427-
def __getitem__(self, __index: int | str) -> _T_co: ...
426+
def __getitem__(self, __index: int | str) -> Any: ...
428427
@overload
429-
def __getitem__(self, __index: slice) -> tuple[_T_co, ...]: ...
428+
def __getitem__(self, __index: slice) -> tuple[Any, ...]: ...
430429
def __hash__(self) -> int: ...
431-
def __iter__(self) -> Iterator[_T_co]: ...
430+
def __iter__(self) -> Iterator[Any]: ...
432431
def __len__(self) -> int: ...
433432
# These return NotImplemented for anything that is not a Row.
434433
def __eq__(self, __other: object) -> bool: ...

0 commit comments

Comments
 (0)
0