|
40 | 40 | //|
|
41 | 41 | //| def __init__(self) -> None:
|
42 | 42 | //| """You cannot create an instance of `usb_cdc.Serial`.
|
43 |
| -//| |
44 |
| -//| Serial objects are pre-constructed for each CDC device in the USB |
45 |
| -//| descriptor and are included in the ``usb_cdc.serials`` tuple.""" |
| 43 | +//| The available instances are in the ``usb_cdc.serials`` tuple.""" |
46 | 44 | //| ...
|
47 | 45 | //|
|
48 | 46 | //| def read(self, size: int = 1) -> bytes:
|
|
63 | 61 | //| :rtype: bytes"""
|
64 | 62 | //| ...
|
65 | 63 | //|
|
66 |
| -//| def readline(self, size=-1) -> Optional[bytes]: |
67 |
| -//| r"""Read a line, ending in a newline character ("\\n"), or |
68 |
| -//| return everything readable if no newline is found and ``timeout`` is 0. |
| 64 | +//| def readline(self, size: int = -1) -> Optional[bytes]: |
| 65 | +//| r"""Read a line ending in a newline character ("\\n"), including the newline. |
| 66 | +//| Return everything readable if no newline is found and ``timeout`` is 0. |
69 | 67 | //| Return ``None`` in case of error.
|
70 | 68 | //|
|
71 | 69 | //| This is a binary stream: the newline character "\\n" cannot be changed.
|
72 |
| -//| If the host computer transmits "\\r" it will be included as part of the line. |
| 70 | +//| If the host computer transmits "\\r" it will also be included as part of the line. |
73 | 71 | //|
|
74 | 72 | //| :param int size: maximum number of characters to read. ``-1`` means as many as possible.
|
75 | 73 | //| :return: the line read
|
76 | 74 | //| :rtype: bytes or None"""
|
77 | 75 | //| ...
|
78 | 76 | //|
|
79 |
| -//| def readlines(self) -> list: |
80 |
| -//| """Read multiple lines as a list, using `readline()` |
| 77 | +//| def readlines(self) -> List[Optional[bytes]]: |
| 78 | +//| """Read multiple lines as a list, using `readline()`. |
81 | 79 | //|
|
82 | 80 | //| .. warning:: If ``timeout`` is ``None``,
|
83 | 81 | //| `readlines()` will never return, because there is no way to indicate end of stream.
|
|
0 commit comments