sqlite3: stubtest fixes (#6441)

This commit is contained in:
Akuli
2021-11-29 21:07:20 +02:00
committed by GitHub
parent f29f0a5394
commit c8c5519fa6
2 changed files with 13 additions and 37 deletions

View File

@@ -83,7 +83,7 @@ version: str
# TODO: adapt needs to get probed
def adapt(obj, protocol, alternate): ...
def complete_statement(sql: str) -> bool: ...
def complete_statement(statement: str) -> bool: ...
if sys.version_info >= (3, 7):
def connect(
@@ -154,16 +154,14 @@ class Connection(object):
# TODO: please check in executemany() if seq_of_parameters type is possible like this
def executemany(self, __sql: str, __parameters: Iterable[Iterable[Any]]) -> Cursor: ...
def executescript(self, __sql_script: bytes | str) -> Cursor: ...
def interrupt(self, *args: Any, **kwargs: Any) -> None: ...
def iterdump(self, *args: Any, **kwargs: Any) -> Generator[str, None, None]: ...
def rollback(self, *args: Any, **kwargs: Any) -> None: ...
# TODO: set_authorizer(authorzer_callback)
# see https://docs.python.org/2/library/sqlite3.html#sqlite3.Connection.set_authorizer
# returns [SQLITE_OK, SQLITE_DENY, SQLITE_IGNORE] so perhaps int
def set_authorizer(self, *args: Any, **kwargs: Any) -> None: ...
# set_progress_handler(handler, n) -> see https://docs.python.org/2/library/sqlite3.html#sqlite3.Connection.set_progress_handler
def set_progress_handler(self, *args: Any, **kwargs: Any) -> None: ...
def set_trace_callback(self, *args: Any, **kwargs: Any) -> None: ...
def interrupt(self) -> None: ...
def iterdump(self) -> Generator[str, None, None]: ...
def rollback(self) -> None: ...
def set_authorizer(
self, authorizer_callback: Callable[[int, str | None, str | None, str | None, str | None], int] | None
) -> None: ...
def set_progress_handler(self, progress_handler: Callable[[], bool | None] | None, n: int) -> None: ...
def set_trace_callback(self, trace_callback: Callable[[str], object] | None) -> None: ...
# enable_load_extension and load_extension is not available on python distributions compiled
# without sqlite3 loadable extension support. see footnotes https://docs.python.org/3/library/sqlite3.html#f1
def enable_load_extension(self, enabled: bool) -> None: ...
@@ -193,15 +191,15 @@ class Cursor(Iterator[Any]):
# required type is sqlite3.Connection (which is imported as _Connection)
# however, the name of the __init__ variable is unknown
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
def close(self, *args: Any, **kwargs: Any) -> None: ...
def close(self) -> None: ...
def execute(self, __sql: str, __parameters: Iterable[Any] = ...) -> Cursor: ...
def executemany(self, __sql: str, __seq_of_parameters: Iterable[Iterable[Any]]) -> Cursor: ...
def executescript(self, __sql_script: bytes | str) -> Cursor: ...
def fetchall(self) -> list[Any]: ...
def fetchmany(self, size: int | None = ...) -> list[Any]: ...
def fetchone(self) -> Any: ...
def setinputsizes(self, *args: Any, **kwargs: Any) -> None: ...
def setoutputsize(self, *args: Any, **kwargs: Any) -> None: ...
def setinputsizes(self, __sizes: object) -> None: ... # does nothing
def setoutputsize(self, __size: object, __column: object = ...) -> None: ... # does nothing
def __iter__(self) -> Cursor: ...
def __next__(self) -> Any: ...
@@ -228,7 +226,7 @@ class ProgrammingError(DatabaseError): ...
class Row(object):
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
def keys(self, *args: Any, **kwargs: Any): ...
def keys(self): ...
def __eq__(self, other): ...
def __ge__(self, other): ...
def __getitem__(self, index): ...

View File

@@ -133,28 +133,6 @@ pyclbr.Function.__init__
sched.Event.__new__
sched.Event._fields
signal.default_int_handler
sqlite3.Connection.interrupt
sqlite3.Connection.iterdump
sqlite3.Connection.rollback
sqlite3.Connection.set_authorizer
sqlite3.Connection.set_progress_handler
sqlite3.Connection.set_trace_callback
sqlite3.Cursor.close
sqlite3.Cursor.setinputsizes
sqlite3.Cursor.setoutputsize
sqlite3.Row.keys
sqlite3.complete_statement
sqlite3.dbapi2.Connection.interrupt
sqlite3.dbapi2.Connection.iterdump
sqlite3.dbapi2.Connection.rollback
sqlite3.dbapi2.Connection.set_authorizer
sqlite3.dbapi2.Connection.set_progress_handler
sqlite3.dbapi2.Connection.set_trace_callback
sqlite3.dbapi2.Cursor.close
sqlite3.dbapi2.Cursor.setinputsizes
sqlite3.dbapi2.Cursor.setoutputsize
sqlite3.dbapi2.Row.keys
sqlite3.dbapi2.complete_statement
ssl.SSLContext.__new__
ssl._create_unverified_context
typing.SupportsRound.__round__