MCPcopy Index your code
hub / github.com/python/cpython / is_in_code

Method is_in_code

Lib/idlelib/hyperparser.py:110–114  ·  view source on GitHub ↗

Is the index given to the HyperParser in normal code?

(self)

Source from the content-addressed store, hash-verified

108 in ('"', "'"))
109
110 def is_in_code(self):
111 """Is the index given to the HyperParser in normal code?"""
112 return (not self.isopener[self.indexbracket] or
113 self.rawtext[self.bracketing[self.indexbracket][0]]
114 not in ('#', '"', "'"))
115
116 def get_surrounding_brackets(self, openers='([{', mustclose=False):
117 """Return bracket indexes or None.

Callers 4

get_expressionMethod · 0.95
paren_closed_eventMethod · 0.95
open_completionsMethod · 0.95
test_is_in_codeMethod · 0.80

Calls

no outgoing calls

Tested by 1

test_is_in_codeMethod · 0.64