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

Function raw_string_bracket

IPython/terminal/shortcuts/auto_match.py:65–73  ·  view source on GitHub ↗

Auto-close bracker in raw strings

(event: KeyPressEvent)

Source from the content-addressed store, hash-verified

63
64
65def raw_string_bracket(event: KeyPressEvent):
66 """Auto-close bracker in raw strings"""
67 matches = re.match(
68 r".*(r|R)[\"'](-*)",
69 event.current_buffer.document.current_line_before_cursor,
70 )
71 dashes = matches.group(2) if matches else ""
72 event.current_buffer.insert_text("[]" + dashes)
73 event.current_buffer.cursor_left(len(dashes) + 1)
74
75
76def raw_string_braces(event: KeyPressEvent):

Callers

nothing calls this directly

Calls 2

matchMethod · 0.80
groupMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…