-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
stubs: false positiveType checkers report false errorsType checkers report false errors
Description
I have a question regarding the type in dbapi's sqlite set_progress_handler
callback return type.
It seems to be defined here:
typeshed/stdlib/sqlite3/dbapi2.pyi
Line 344 in a750a42
def set_progress_handler(self, progress_handler: Callable[[], bool | None] | None, n: int) -> None: ... |
and to set the return type to an optional bool.
But from what I see in the docs and from the behaviour when trying to use it the callback should return an int
and if that is a non-zero int the execution will be terminated.
Now, with boolean this will also work, but execution would be terminated if True
is returned, and it would keep on going if False
is returned.
I think it would make more sense to have the type definitions aligned with the docs and have it return an Optional int.
Metadata
Metadata
Assignees
Labels
stubs: false positiveType checkers report false errorsType checkers report false errors