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

Method breakable

IPython/lib/pretty.py:249–266  ·  view source on GitHub ↗

Add a breakable separator to the output. This does not mean that it will automatically break here. If no breaking on this position takes place the `sep` is inserted which default to one space.

(self, sep=' ')

Source from the content-addressed store, hash-verified

247 self.output_width += width
248
249 def breakable(self, sep=' '):
250 """
251 Add a breakable separator to the output. This does not mean that it
252 will automatically break here. If no breaking on this position takes
253 place the `sep` is inserted which default to one space.
254 """
255 width = len(sep)
256 group = self.group_stack[-1]
257 if group.want_break:
258 self.flush()
259 self.output.write(self.newline)
260 self.output.write(' ' * self.indentation)
261 self.output_width = self.indentation
262 self.buffer_width = 0
263 else:
264 self.buffer.append(Breakable(sep, width, self))
265 self.buffer_width += width
266 self._break_outer_groups()
267
268 def break_(self):
269 """

Callers 6

_enumerateMethod · 0.95
new_itemMethod · 0.80
_default_pprintFunction · 0.80
innerFunction · 0.80
_super_pprintFunction · 0.80
_repr_pretty_Method · 0.80

Calls 4

flushMethod · 0.95
_break_outer_groupsMethod · 0.95
BreakableClass · 0.85
writeMethod · 0.45

Tested by 1

_repr_pretty_Method · 0.64