Use _typeshed.Self with __enter__ (#5712)

This commit is contained in:
Anton Grübel
2021-06-30 00:19:25 +02:00
committed by GitHub
parent 35cc7491db
commit c38171a0b3
8 changed files with 24 additions and 27 deletions

View File

@@ -1,4 +1,5 @@
import sys
from _typeshed import Self
from types import TracebackType
from typing import (
IO,
@@ -80,7 +81,7 @@ class ExitStack(ContextManager[ExitStack]):
def callback(self, callback: Callable[..., Any], *args: Any, **kwds: Any) -> Callable[..., Any]: ...
def pop_all(self: _U) -> _U: ...
def close(self) -> None: ...
def __enter__(self: _U) -> _U: ...
def __enter__(self: Self) -> Self: ...
def __exit__(
self,
__exc_type: Optional[Type[BaseException]],