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

Class RawStringLiteral

IPython/lib/pretty.py:582–595  ·  view source on GitHub ↗

Wrapper that shows a string with a `r` prefix

Source from the content-addressed store, hash-verified

580
581
582class RawStringLiteral:
583 """ Wrapper that shows a string with a `r` prefix """
584 def __init__(self, value):
585 self.value = value
586
587 def _repr_pretty_(self, p, cycle):
588 base_repr = repr(self.value)
589 if base_repr[:1] in 'uU':
590 base_repr = base_repr[1:]
591 prefix = 'ur'
592 else:
593 prefix = 'r'
594 base_repr = prefix + base_repr.replace('\\\\', '\\')
595 p.text(base_repr)
596
597
598def _default_pprint(obj, p, cycle):

Callers 1

_re_pattern_pprintFunction · 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…