mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-03-05 14:44:18 +08:00
Use typing_extensions.Self instead of _typeshed.Self (#9702)
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
from _typeshed import Incomplete, Self
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Callable, Coroutine, Mapping, Sequence
|
||||
from contextlib import AbstractContextManager
|
||||
from types import TracebackType
|
||||
from typing import Any, Generic, TypeVar, overload
|
||||
from typing_extensions import Literal
|
||||
from typing_extensions import Literal, Self
|
||||
|
||||
_F = TypeVar("_F", bound=Callable[..., Any])
|
||||
_AF = TypeVar("_AF", bound=Callable[..., Coroutine[Any, Any, Any]])
|
||||
@@ -45,7 +45,7 @@ DEFAULT: _SentinelObject
|
||||
|
||||
class _Call(tuple[Any, ...]):
|
||||
def __new__(
|
||||
cls: type[Self],
|
||||
cls,
|
||||
value: Any = ...,
|
||||
name: Incomplete | None = ...,
|
||||
parent: Incomplete | None = ...,
|
||||
@@ -85,7 +85,7 @@ class Base:
|
||||
# something that can't be expressed with our static type system.
|
||||
class NonCallableMock(Base, Any):
|
||||
def __new__(
|
||||
cls: type[Self],
|
||||
cls,
|
||||
spec: list[str] | object | type[object] | None = ...,
|
||||
wraps: Incomplete | None = ...,
|
||||
name: str | None = ...,
|
||||
@@ -373,7 +373,7 @@ class _SpecState:
|
||||
def mock_open(mock: Incomplete | None = ..., read_data: Any = ...) -> Any: ...
|
||||
|
||||
class PropertyMock(Mock):
|
||||
def __get__(self: Self, obj: _T, obj_type: type[_T] | None = ...) -> Self: ...
|
||||
def __get__(self, obj: _T, obj_type: type[_T] | None = ...) -> Self: ...
|
||||
def __set__(self, obj: Any, value: Any) -> None: ...
|
||||
|
||||
def seal(mock: Any) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user