Make peewee stubs compatible with peewee 3.15.4 (#9176)

This commit is contained in:
Akuli
2022-11-13 02:12:55 +02:00
committed by GitHub
parent 7fc9b8e2c8
commit 02f2bc30e7
2 changed files with 19 additions and 8 deletions

View File

@@ -618,6 +618,8 @@ class MutableMapping(Mapping[_KT, _VT], Generic[_KT, _VT]):
# -- os._Environ.__ior__
# -- collections.UserDict.__ior__
# -- collections.ChainMap.__ior__
# -- peewee.attrdict.__add__
# -- peewee.attrdict.__iadd__
# -- weakref.WeakValueDictionary.__ior__
# -- weakref.WeakKeyDictionary.__ior__
@overload

View File

@@ -1,9 +1,9 @@
import itertools
import logging
import threading
from _typeshed import Incomplete
from collections.abc import Generator
from typing import NamedTuple
from _typeshed import Incomplete, Self, SupportsKeysAndGetItem
from collections.abc import Generator, Iterable
from typing import ClassVar, NamedTuple, TypeVar
class NullHandler(logging.Handler):
def emit(self, record) -> None: ...
@@ -15,15 +15,19 @@ basestring = str
long = int
izip_longest = itertools.zip_longest
class attrdict(dict[Incomplete, Incomplete]):
def __getattr__(self, attr): ...
def __setattr__(self, attr, value) -> None: ...
def __iadd__(self, rhs): ...
def __add__(self, rhs): ...
_VT = TypeVar("_VT")
class attrdict(dict[str, _VT]):
def __getattr__(self, attr: str) -> _VT: ...
def __setattr__(self, attr: str, value: _VT) -> None: ...
# calls dict.update()
def __iadd__(self: Self, rhs: SupportsKeysAndGetItem[str, _VT] | Iterable[tuple[str, _VT]]) -> Self: ...
def __add__(self, rhs: SupportsKeysAndGetItem[str, _VT] | Iterable[tuple[str, _VT]]) -> attrdict[_VT]: ...
OP: Incomplete
DJANGO_MAP: Incomplete
JOIN: Incomplete
PREFETCH_TYPE: attrdict[int]
def chunked(it, n) -> Generator[Incomplete, None, None]: ...
@@ -47,6 +51,8 @@ class DatabaseProxy(Proxy):
def manual_commit(self): ...
def transaction(self, *args, **kwargs): ...
def savepoint(self): ...
@property
def Model(self) -> type[Model]: ...
class ModelDescriptor: ...
@@ -369,6 +375,7 @@ class SQL(ColumnBase):
def Check(constraint, name: Incomplete | None = ...): ...
class Function(ColumnBase):
no_coerce_functions: ClassVar[set[str]]
name: Incomplete
arguments: Incomplete
def __init__(self, name, arguments, coerce: bool = ..., python_value: Incomplete | None = ...) -> None: ...
@@ -820,6 +827,8 @@ class Database(_callable_context_manager):
def bind(self, models, bind_refs: bool = ..., bind_backrefs: bool = ...) -> None: ...
def bind_ctx(self, models, bind_refs: bool = ..., bind_backrefs: bool = ...): ...
def get_noop_select(self, ctx): ...
@property
def Model(self) -> type[Model]: ...
class SqliteDatabase(Database):
field_types: Incomplete