Skip to content

Commit c77d66a

Browse files
committed
fix: override writelines and ignore the supertype violation
Man, the `io` classes and interfaces are a mess.
1 parent fc00739 commit c77d66a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

io_chunks/raw_io_chunk.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
UnsupportedOperation,
1010
)
1111
from types import TracebackType
12-
from typing import IO, Optional, Type, Union
12+
from typing import IO, Iterable, Optional, Type, Union
1313

1414
from .exceptions import ClosedStreamError
1515

@@ -206,3 +206,11 @@ def fileno(self) -> int:
206206
Returns the underlying stream `fileno`.
207207
"""
208208
return self._stream.fileno()
209+
210+
def writelines(self, lines: Iterable[bytes]): # type: ignore[override]
211+
"""
212+
This streams doesn't support writing.
213+
214+
:raises UnsupportedOperation:
215+
"""
216+
raise UnsupportedOperation("This stream doesn't support write")

0 commit comments

Comments
 (0)