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

Method text

IPython/lib/pretty.py:216–229  ·  view source on GitHub ↗

Add literal text to the output.

(self, obj)

Source from the content-addressed store, hash-verified

214 self._break_one_group(group)
215
216 def text(self, obj):
217 """Add literal text to the output."""
218 width = len(obj)
219 if self.buffer:
220 text = self.buffer[-1]
221 if not isinstance(text, Text):
222 text = Text()
223 self.buffer.append(text)
224 text.add(obj, width)
225 self.buffer_width += width
226 self._break_outer_groups()
227 else:
228 self.output.write(obj)
229 self.output_width += width
230
231 def breakable(self, sep=' '):
232 """

Callers 15

begin_groupMethod · 0.95
_enumerateMethod · 0.95
end_groupMethod · 0.95
_default_pprintFunction · 0.45
innerFunction · 0.45
_super_pprintFunction · 0.45
_re_pattern_pprintFunction · 0.45
_type_pprintFunction · 0.45
_repr_pprintFunction · 0.45
_function_pprintFunction · 0.45
_exception_pprintFunction · 0.45

Calls 4

addMethod · 0.95
_break_outer_groupsMethod · 0.95
TextClass · 0.85
writeMethod · 0.45

Tested by 4

_repr_pretty_Method · 0.36
_repr_pretty_Method · 0.36
_repr_pretty_Method · 0.36
_repr_pretty_Method · 0.36