Improve __enter__ & constructor methods (#7114)

This commit is contained in:
Alex Waygood
2022-02-02 21:14:59 +00:00
committed by GitHub
parent 7ccbbdb30a
commit b4e97a1909
11 changed files with 39 additions and 21 deletions

View File

@@ -1,4 +1,5 @@
import threading
from _typeshed import Self
from types import TracebackType
from typing import Iterator, Protocol
from typing_extensions import Literal
@@ -22,7 +23,7 @@ class Spinner(object):
def start(self) -> None: ...
def stop(self) -> None: ...
def init_spin(self) -> None: ...
def __enter__(self) -> Spinner: ...
def __enter__(self: Self) -> Self: ...
def __exit__(
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> Literal[False]: ...