mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-27 03:52:19 +08:00
Use typing_extensions.Self instead of _typeshed.Self (#9702)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import abc
|
||||
from _typeshed import Incomplete, Self
|
||||
from _typeshed import Incomplete
|
||||
from typing import Any
|
||||
from typing_extensions import Self
|
||||
|
||||
ConnectionError: Any
|
||||
|
||||
@@ -38,7 +39,7 @@ class _InProcessGlobalCache(GlobalCache):
|
||||
class RedisCache(GlobalCache):
|
||||
transient_errors: Any
|
||||
@classmethod
|
||||
def from_environment(cls: type[Self], strict_read: bool = ..., strict_write: bool = ...) -> Self: ...
|
||||
def from_environment(cls, strict_read: bool = ..., strict_write: bool = ...) -> Self: ...
|
||||
redis: Any
|
||||
strict_read: Any
|
||||
strict_write: Any
|
||||
@@ -60,9 +61,7 @@ class MemcacheCache(GlobalCache):
|
||||
def __eq__(self, other): ...
|
||||
transient_errors: Any
|
||||
@classmethod
|
||||
def from_environment(
|
||||
cls: type[Self], max_pool_size: int = ..., strict_read: bool = ..., strict_write: bool = ...
|
||||
) -> Self: ...
|
||||
def from_environment(cls, max_pool_size: int = ..., strict_read: bool = ..., strict_write: bool = ...) -> Self: ...
|
||||
client: Any
|
||||
strict_read: Any
|
||||
strict_write: Any
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import datetime
|
||||
from _typeshed import Self
|
||||
from collections.abc import Callable, Iterable, Sequence
|
||||
from typing import Any, NoReturn
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
from typing_extensions import Literal, Self, TypeAlias
|
||||
|
||||
from google.cloud.ndb import exceptions, key as key_module, query as query_module, tasklets as tasklets_module
|
||||
|
||||
@@ -27,7 +26,7 @@ class _NotEqualMixin:
|
||||
_Direction: TypeAlias = Literal["asc", "desc"]
|
||||
|
||||
class IndexProperty(_NotEqualMixin):
|
||||
def __new__(cls: type[Self], name: str, direction: _Direction) -> Self: ...
|
||||
def __new__(cls, name: str, direction: _Direction) -> Self: ...
|
||||
@property
|
||||
def name(self) -> str: ...
|
||||
@property
|
||||
@@ -36,7 +35,7 @@ class IndexProperty(_NotEqualMixin):
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
class Index(_NotEqualMixin):
|
||||
def __new__(cls: type[Self], kind: str, properties: list[IndexProperty], ancestor: bool) -> Self: ...
|
||||
def __new__(cls, kind: str, properties: list[IndexProperty], ancestor: bool) -> Self: ...
|
||||
@property
|
||||
def kind(self) -> str: ...
|
||||
@property
|
||||
@@ -59,7 +58,7 @@ class IndexState(_NotEqualMixin):
|
||||
|
||||
class ModelAdapter:
|
||||
# This actually returns NoReturn, but mypy can't handle that
|
||||
def __new__(cls: type[Self], *args, **kwargs) -> Self: ...
|
||||
def __new__(cls, *args, **kwargs) -> Self: ...
|
||||
|
||||
def make_connection(*args, **kwargs) -> NoReturn: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user