MCPcopy Index your code
hub / github.com/bpython/bpython / format

Method format

bpython/curtsiesfrontend/interpreter.py:58–65  ·  view source on GitHub ↗
(self, tokensource, outfile)

Source from the content-addressed store, hash-verified

56 super().__init__(**options) # type: ignore
57
58 def format(self, tokensource, outfile):
59 o = ""
60
61 for token, text in tokensource:
62 while token not in self.f_strings:
63 token = token.parent
64 o += f"{self.f_strings[token]}\x03{text}\x04"
65 outfile.write(parse(o.rstrip()))
66
67
68class Interp(ReplInterpreter):

Callers 1

formatMethod · 0.95

Calls 2

parseFunction · 0.90
writeMethod · 0.45

Tested by

no test coverage detected