Skip to content

Commit c8da5d6

Browse files
committed
add disjoint_base to cython compiled classes
1 parent 4a8c237 commit c8da5d6

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

stubs/cysqlite/cysqlite/_cysqlite.pyi

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import sys
22
import types
33
from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence
44
from typing import Any, ClassVar, Literal, NoReturn, ParamSpec, TypeAlias, TypeVar, final
5+
from typing_extensions import disjoint_base
56

67
from cysqlite.metadata import Column, ColumnMetadata, ForeignKey, Index, View
78

@@ -60,14 +61,15 @@ def status(flag: int) -> tuple[int, int]: ...
6061
threadsafety: int
6162

6263
def vfs_list() -> list[str]: ...
63-
64+
@disjoint_base
6465
class Atomic(_callable_context_manager):
6566
txn: Transaction | Savepoint
6667
def __init__(self, conn: Connection, lock: _IsolationLevel = None) -> None: ...
6768
def __enter__(self) -> Transaction | Savepoint: ...
6869
def __exit__(self, type: type[BaseException] | None, value: BaseException | None, traceback: types.TracebackType | None): ...
6970
def __reduce__(self): ...
7071

72+
@disjoint_base
7173
class Blob:
7274
closed: bool
7375
def __init__(
@@ -102,6 +104,7 @@ class Blob:
102104
def __setitem__(self, key: int | slice[int, int, int] | slice[int, int], value: Buffer) -> None: ...
103105

104106
@final
107+
@disjoint_base
105108
class Connection(_callable_context_manager):
106109
cached_statements: int
107110
callback_error: BaseException | None
@@ -238,6 +241,7 @@ class Connection(_callable_context_manager):
238241
def __reduce__(self): ...
239242

240243
@final
244+
@disjoint_base
241245
class Cursor:
242246
conn: Connection
243247
description: tuple[str, ...]
@@ -260,6 +264,7 @@ class Cursor:
260264
def __next__(self) -> Row | Any: ...
261265
def __reduce__(self): ...
262266

267+
@disjoint_base
263268
class Row:
264269
def as_dict(self) -> dict[str, Any]: ...
265270
def get(self, key: str | int, default: _T | None = ...) -> Any | _T | None: ...
@@ -280,6 +285,7 @@ class Row:
280285
def __ne__(self, other: object) -> bool: ...
281286
def __reduce__(self): ...
282287

288+
@disjoint_base
283289
class Savepoint(_callable_context_manager):
284290
def __init__(self, conn: Connection, sid: str | None = None) -> None: ...
285291
def commit(self, begin: bool = True) -> None: ...
@@ -288,6 +294,7 @@ class Savepoint(_callable_context_manager):
288294
def __exit__(self, type: type[BaseException] | None, value: BaseException | None, traceback: types.TracebackType | None): ...
289295
def __reduce__(self): ...
290296

297+
@disjoint_base
291298
class TableFunction:
292299
_ncols: ClassVar[int] = ...
293300
_nparams: ClassVar[int] = ...
@@ -305,6 +312,7 @@ class TableFunction:
305312
def iterate(self, idx: int) -> tuple[Any, ...]: ...
306313
def update(self, old_rowid: int, new_rowid: int, values: list[Any]): ...
307314

315+
@disjoint_base
308316
class Transaction(_callable_context_manager):
309317
def __init__(self, conn: Connection, lock: _IsolationLevel = None) -> None: ...
310318
def commit(self, begin: bool = True) -> None: ...
@@ -313,10 +321,12 @@ class Transaction(_callable_context_manager):
313321
def __exit__(self, type: type[BaseException] | None, value: BaseException | None, traceback: types.TracebackType | None): ...
314322
def __reduce__(self): ...
315323

324+
@disjoint_base
316325
class _callable_context_manager:
317326
def __call__(self, fn: Callable[_P, _T]) -> Callable[_P, _T]: ...
318327
def __reduce__(self): ...
319328

329+
@disjoint_base
320330
class median:
321331
def __init__(self) -> None: ...
322332
def finalize(self) -> float: ...

0 commit comments

Comments
 (0)