MCPcopy Create free account
hub / github.com/bpython/bpython / __init__

Method __init__

bpython/curtsiesfrontend/coderunner.py:205–215  ·  view source on GitHub ↗

Fakes sys.stdout or sys.stderr on_write should always take unicode fileno should be the fileno that on_write will output to (e.g. 1 for standard output).

(self, coderunner, on_write, real_fileobj)

Source from the content-addressed store, hash-verified

203
204class FakeOutput:
205 def __init__(self, coderunner, on_write, real_fileobj):
206 """Fakes sys.stdout or sys.stderr
207
208 on_write should always take unicode
209
210 fileno should be the fileno that on_write will
211 output to (e.g. 1 for standard output).
212 """
213 self.coderunner = coderunner
214 self.on_write = on_write
215 self._real_fileobj = real_fileobj
216
217 def write(self, s, *args, **kwargs):
218 self.on_write(s, *args, **kwargs)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected