mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 00:37:10 +08:00
Improve many __(a)exit__ annotations (#9696)
This commit is contained in:
@@ -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: ...
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user