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

Method _repr_pretty_

IPython/lib/pretty.py:558–579  ·  view source on GitHub ↗
(self, p, cycle)

Source from the content-addressed store, hash-verified

556 return inner
557
558 def _repr_pretty_(self, p, cycle):
559 # dunders are to avoid clashes with kwargs, as python's name managing
560 # will kick in.
561
562 started = False
563 def new_item():
564 nonlocal started
565 if started:
566 p.text(",")
567 p.breakable()
568 started = True
569
570 prefix = self.name + "("
571 with p.group(len(prefix), prefix, ")"):
572 for arg in self.args:
573 new_item()
574 p.pretty(arg)
575 for arg_name, arg in self.kwargs.items():
576 new_item()
577 arg_prefix = arg_name + "="
578 with p.group(len(arg_prefix), arg_prefix):
579 p.pretty(arg)
580
581
582class RawStringLiteral:

Callers

nothing calls this directly

Calls 2

groupMethod · 0.80
prettyMethod · 0.80

Tested by

no test coverage detected