Skip to content

Commit 24ac815

Browse files
committed
Clarify further; fix type error
1 parent 1a6c021 commit 24ac815

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

shared-bindings/usb_cdc/Serial.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@
4040
//|
4141
//| def __init__(self) -> None:
4242
//| """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."""
4644
//| ...
4745
//|
4846
//| def read(self, size: int = 1) -> bytes:
@@ -63,21 +61,21 @@
6361
//| :rtype: bytes"""
6462
//| ...
6563
//|
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.
6967
//| Return ``None`` in case of error.
7068
//|
7169
//| 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.
7371
//|
7472
//| :param int size: maximum number of characters to read. ``-1`` means as many as possible.
7573
//| :return: the line read
7674
//| :rtype: bytes or None"""
7775
//| ...
7876
//|
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()`.
8179
//|
8280
//| .. warning:: If ``timeout`` is ``None``,
8381
//| `readlines()` will never return, because there is no way to indicate end of stream.

0 commit comments

Comments
 (0)