MCPcopy Create free account
hub / github.com/ipython/ipython / breakable

Method breakable

IPython/lib/pretty.py:231–248  ·  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

229 self.output_width += width
230
231 def breakable(self, sep=' '):
232 """
233 Add a breakable separator to the output. This does not mean that it
234 will automatically break here. If no breaking on this position takes
235 place the `sep` is inserted which default to one space.
236 """
237 width = len(sep)
238 group = self.group_stack[-1]
239 if group.want_break:
240 self.flush()
241 self.output.write(self.newline)
242 self.output.write(' ' * self.indentation)
243 self.output_width = self.indentation
244 self.buffer_width = 0
245 else:
246 self.buffer.append(Breakable(sep, width, self))
247 self.buffer_width += width
248 self._break_outer_groups()
249
250 def break_(self):
251 """

Callers 9

_enumerateMethod · 0.95
_default_pprintFunction · 0.80
innerFunction · 0.80
_super_pprintFunction · 0.80
_re_pattern_pprintFunction · 0.80
_exception_pprintFunction · 0.80
_defaultdict_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