File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change 45
45
//| descriptor and are included in the ``usb_cdc.serials`` tuple."""
46
46
//| ...
47
47
//|
48
-
49
48
//| def read(self, size: int = 1) -> bytes:
50
49
//| """Read at most ``size`` bytes. If ``size`` exceeds the internal buffer size
51
50
//| only the bytes in the buffer will be read. If `timeout` is > 0 or ``None``,
64
63
//| :rtype: bytes"""
65
64
//| ...
66
65
//|
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.
69
+ //| Return ``None`` in case of error.
70
+ //|
71
+ //| This is a binary stream: the newline character cannot be changed.
72
+ //|
73
+ //| :param int size: maximum number of characters to read. ``-1`` means as many as possible.
74
+ //| :return: the line read
75
+ //| :rtype: bytes or None"""
76
+ //| ...
77
+ //|
78
+ //| def readlines(self) -> list:
79
+ //| """Read multiple lines as a list, using `readline()`
80
+ //|
81
+ //| .. warning:: If ``timeout`` is ``None``,
82
+ //| `readlines()` will never return, because there is no way to indicate end of stream.
83
+ //|
84
+ //| :return: a list of the line read
85
+ //| :rtype: list"""
86
+ //| ...
87
+ //|
67
88
//| def write(self, buf: ReadableBuffer) -> int:
68
89
//| """Write as many bytes as possible from the buffer of bytes.
69
90
//|
You can’t perform that action at this time.
0 commit comments