mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 20:24:30 +08:00
Fix mistyped get_by_id class methods (#7120)
The types for these class methods were mixed up. The async method returned an optional `Model`, while the synchronous method returned a `Future`. It's the other way around. Fixes #7103
This commit is contained in:
@@ -320,7 +320,7 @@ class Model(_NotEqualMixin, metaclass=MetaModel):
|
||||
max_memcache_items: int | None = ...,
|
||||
force_writes: bool | None = ...,
|
||||
_options=...,
|
||||
) -> tasklets_module.Future: ...
|
||||
) -> Model | None: ...
|
||||
@classmethod
|
||||
def get_by_id_async(
|
||||
cls: type[Model],
|
||||
@@ -344,7 +344,7 @@ class Model(_NotEqualMixin, metaclass=MetaModel):
|
||||
max_memcache_items: int | None = ...,
|
||||
force_writes: bool | None = ...,
|
||||
_options=...,
|
||||
) -> Model | None: ...
|
||||
) -> tasklets_module.Future: ...
|
||||
@classmethod
|
||||
def get_or_insert(
|
||||
cls: type[Model],
|
||||
|
||||
Reference in New Issue
Block a user