Improve many __(a)exit__ annotations (#9696)

This commit is contained in:
Avasam
2023-02-25 16:50:30 -05:00
committed by GitHub
parent db821101b8
commit 52ec44fa58
45 changed files with 216 additions and 81 deletions

View File

@@ -1,6 +1,7 @@
import threading
from _typeshed import ReadableBuffer
from collections.abc import Callable
from types import TracebackType
from typing_extensions import Self
from serial import Serial
@@ -42,4 +43,6 @@ class ReaderThread(threading.Thread):
def close(self) -> None: ...
def connect(self) -> tuple[Self, Protocol]: ...
def __enter__(self) -> Protocol: ...
def __exit__(self, __exc_type: object, __exc_val: object, __exc_tb: object) -> None: ...
def __exit__(
self, __exc_type: type[BaseException] | None, __exc_val: BaseException | None, __exc_tb: TracebackType | None
) -> None: ...

View File

@@ -1,6 +1,7 @@
import codecs
import sys
import threading
from _typeshed import Unused
from collections.abc import Iterable
from typing import Any, BinaryIO, TextIO
from typing_extensions import Self
@@ -20,7 +21,7 @@ class ConsoleBase:
def write(self, text: str) -> None: ...
def cancel(self) -> None: ...
def __enter__(self) -> Self: ...
def __exit__(self, *args: object, **kwargs: object) -> None: ...
def __exit__(self, *args: Unused, **kwargs: Unused) -> None: ...
if sys.platform == "win32":
class Out: