mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Use typing_extensions.Self in the stdlib (#9694)
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import abc
|
||||
import sys
|
||||
from _typeshed import FileDescriptorOrPath, Self, Unused
|
||||
from _typeshed import FileDescriptorOrPath, Unused
|
||||
from abc import abstractmethod
|
||||
from collections.abc import AsyncGenerator, AsyncIterator, Awaitable, Callable, Generator, Iterator
|
||||
from types import TracebackType
|
||||
from typing import IO, Any, Generic, Protocol, TypeVar, overload, runtime_checkable
|
||||
from typing_extensions import ParamSpec, TypeAlias
|
||||
from typing_extensions import ParamSpec, Self, TypeAlias
|
||||
|
||||
__all__ = [
|
||||
"contextmanager",
|
||||
@@ -140,9 +140,9 @@ class ExitStack(metaclass=abc.ABCMeta):
|
||||
def enter_context(self, cm: AbstractContextManager[_T]) -> _T: ...
|
||||
def push(self, exit: _CM_EF) -> _CM_EF: ...
|
||||
def callback(self, __callback: Callable[_P, _T], *args: _P.args, **kwds: _P.kwargs) -> Callable[_P, _T]: ...
|
||||
def pop_all(self: Self) -> Self: ...
|
||||
def pop_all(self) -> Self: ...
|
||||
def close(self) -> None: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __enter__(self) -> Self: ...
|
||||
def __exit__(
|
||||
self, __exc_type: type[BaseException] | None, __exc_value: BaseException | None, __traceback: TracebackType | None
|
||||
) -> bool: ...
|
||||
@@ -163,9 +163,9 @@ class AsyncExitStack(metaclass=abc.ABCMeta):
|
||||
def push_async_callback(
|
||||
self, __callback: Callable[_P, Awaitable[_T]], *args: _P.args, **kwds: _P.kwargs
|
||||
) -> Callable[_P, Awaitable[_T]]: ...
|
||||
def pop_all(self: Self) -> Self: ...
|
||||
def pop_all(self) -> Self: ...
|
||||
async def aclose(self) -> None: ...
|
||||
async def __aenter__(self: Self) -> Self: ...
|
||||
async def __aenter__(self) -> Self: ...
|
||||
async def __aexit__(
|
||||
self, __exc_type: type[BaseException] | None, __exc_value: BaseException | None, __traceback: TracebackType | None
|
||||
) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user