MCPcopy Index your code
hub / github.com/ipython/ipython / Breakable

Class Breakable

IPython/lib/pretty.py:468–487  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

466
467
468class Breakable(Printable):
469
470 def __init__(self, seq, width, pretty):
471 self.obj = seq
472 self.width = width
473 self.pretty = pretty
474 self.indentation = pretty.indentation
475 self.group = pretty.group_stack[-1]
476 self.group.breakables.append(self)
477
478 def output(self, stream, output_width):
479 self.group.breakables.popleft()
480 if self.group.want_break:
481 stream.write(self.pretty.newline)
482 stream.write(' ' * self.indentation)
483 return self.indentation
484 if not self.group.breakables:
485 self.pretty.group_queue.remove(self.group)
486 stream.write(self.obj)
487 return output_width + self.width
488
489
490class Group(Printable):

Callers 1

breakableMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…