Skip to content

Fix positional-only differences in sqlite3 #7222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions stdlib/sqlite3/dbapi2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import sys
from _typeshed import Self, StrOrBytesPath
from datetime import date, datetime, time
from typing import Any, Callable, Generator, Iterable, Iterator, Protocol, TypeVar
from typing_extensions import final
from typing_extensions import Literal, final

_T = TypeVar("_T")

Expand Down Expand Up @@ -183,7 +183,7 @@ class Connection:

def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, t: type | None, exc: BaseException | None, tb: Any | None) -> None: ...
def __exit__(self, __type: type | None, __value: BaseException | None, __traceback: Any | None) -> Literal[False]: ...

class Cursor(Iterator[Any]):
arraysize: Any
Expand Down Expand Up @@ -233,16 +233,16 @@ class ProgrammingError(DatabaseError): ...
class Row:
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
def keys(self): ...
def __eq__(self, other): ...
def __ge__(self, other): ...
def __getitem__(self, index): ...
def __gt__(self, other): ...
def __eq__(self, __other): ...
def __ge__(self, __other): ...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arguably this shouldn't exist. The type defines the tp_richcompare slot, which I believe automatically gets mapped to all six Python-level dunders, but it always returns NotImplemented for anything other than EQ and NE. As a result, sorted(list[Row]) doesn't work, but a type checker will allow it. Anyway, that's a problem for another day.

def __getitem__(self, __index): ...
def __gt__(self, __other): ...
def __hash__(self): ...
def __iter__(self): ...
def __le__(self, other): ...
def __le__(self, __other): ...
def __len__(self): ...
def __lt__(self, other): ...
def __ne__(self, other): ...
def __lt__(self, __other): ...
def __ne__(self, __other): ...

if sys.version_info < (3, 8):
class Statement:
Expand Down