Use typing_extensions.Self instead of _typeshed.Self (#9702)

This commit is contained in:
Alex Waygood
2023-02-15 11:32:43 +01:00
committed by GitHub
parent 8cd6d81f15
commit 7180d0223b
140 changed files with 597 additions and 610 deletions

View File

@@ -1,6 +1,7 @@
import threading
from _typeshed import ReadableBuffer, Self
from _typeshed import ReadableBuffer
from collections.abc import Callable
from typing_extensions import Self
from serial import Serial
@@ -39,6 +40,6 @@ class ReaderThread(threading.Thread):
def stop(self) -> None: ...
def write(self, data: ReadableBuffer) -> int: ...
def close(self) -> None: ...
def connect(self: Self) -> tuple[Self, Protocol]: ...
def connect(self) -> tuple[Self, Protocol]: ...
def __enter__(self) -> Protocol: ...
def __exit__(self, __exc_type: object, __exc_val: object, __exc_tb: object) -> None: ...

View File

@@ -1,9 +1,9 @@
import codecs
import sys
import threading
from _typeshed import Self
from collections.abc import Iterable
from typing import Any, BinaryIO, TextIO
from typing_extensions import Self
from serial import Serial
@@ -19,7 +19,7 @@ class ConsoleBase:
def write_bytes(self, byte_string: bytes) -> None: ...
def write(self, text: str) -> None: ...
def cancel(self) -> None: ...
def __enter__(self: Self) -> Self: ...
def __enter__(self) -> Self: ...
def __exit__(self, *args: object, **kwargs: object) -> None: ...
if sys.platform == "win32":