MCPcopy Index your code
hub / github.com/python/mypy / WriteToConn

Class WriteToConn

mypy/dmypy_util.py:46–117  ·  view source on GitHub ↗

Helper class to write to a connection instead of standard output.

Source from the content-addressed store, hash-verified

44
45
46class WriteToConn(TextIO):
47 """Helper class to write to a connection instead of standard output."""
48
49 def __init__(self, server: IPCBase, output_key: str, isatty: bool) -> None:
50 self.server = server
51 self.output_key = output_key
52 self._isatty = isatty
53
54 def __enter__(self) -> TextIO:
55 return self
56
57 def __exit__(
58 self,
59 t: type[BaseException] | None,
60 value: BaseException | None,
61 traceback: TracebackType | None,
62 ) -> None:
63 pass
64
65 def __iter__(self) -> Iterator[str]:
66 raise io.UnsupportedOperation
67
68 def __next__(self) -> str:
69 raise io.UnsupportedOperation
70
71 def close(self) -> None:
72 pass
73
74 def fileno(self) -> int:
75 raise OSError
76
77 def flush(self) -> None:
78 pass
79
80 def isatty(self) -> bool:
81 return self._isatty
82
83 def read(self, n: int = 0) -> str:
84 raise io.UnsupportedOperation
85
86 def readable(self) -> bool:
87 return False
88
89 def readline(self, limit: int = 0) -> str:
90 raise io.UnsupportedOperation
91
92 def readlines(self, hint: int = 0) -> list[str]:
93 raise io.UnsupportedOperation
94
95 def seek(self, offset: int, whence: int = 0) -> int:
96 raise io.UnsupportedOperation
97
98 def seekable(self) -> bool:
99 return False
100
101 def tell(self) -> int:
102 raise io.UnsupportedOperation
103

Callers 1

serveMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…