Closed
Description
The func parameter type for sqlite3's create_function()
is defined as callback | None
(see docs) but the typeshed stub does not include None
as a valid type. This is a long-undocumented feature that was only recently added to the docs (see related issue python/cpython#95235 and commit python/cpython@5012bed).
In stdlib/sqlite3/dbapi2.pyi, the annotation for this parameter currently reads func: Callable[..., _SqliteData]
(link) but it should be changed to func: Callable[..., _SqliteData] | None
:
if sys.version_info >= (3, 8):
def create_function(
self, name: str, narg: int, func: Callable[..., _SqliteData] | None, *, deterministic: bool = ...
) -> None: ...
else:
def create_function(
self, name: str, num_params: int, func: Callable[..., _SqliteData] | None
) -> None: ...
Metadata
Metadata
Assignees
Labels
No labels