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

Function raw_string_parenthesis

IPython/terminal/shortcuts/auto_match.py:54–62  ·  view source on GitHub ↗

Auto-close parenthesis in raw strings

(event: KeyPressEvent)

Source from the content-addressed store, hash-verified

52
53
54def raw_string_parenthesis(event: KeyPressEvent):
55 """Auto-close parenthesis in raw strings"""
56 matches = re.match(
57 r".*(r|R)[\"'](-*)",
58 event.current_buffer.document.current_line_before_cursor,
59 )
60 dashes = matches.group(2) if matches else ""
61 event.current_buffer.insert_text("()" + dashes)
62 event.current_buffer.cursor_left(len(dashes) + 1)
63
64
65def raw_string_bracket(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…