1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
from abc import abstractmethod from typing import Optional from public import public from .base import Target @public class SerialTarget(Target): @abstractmethod def write(self, data: bytes): ... @abstractmethod def read(self, num: Optional[int] = 0, timeout: Optional[int] = 0) -> bytes: ...