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

Method is_in_string

Lib/idlelib/hyperparser.py:102–108  ·  view source on GitHub ↗

Is the index given to the HyperParser in a string?

(self)

Source from the content-addressed store, hash-verified

100 self.indexbracket += 1
101
102 def is_in_string(self):
103 """Is the index given to the HyperParser in a string?"""
104 # The bracket to which we belong should be an opener.
105 # If it's an opener, it has to have a character.
106 return (self.isopener[self.indexbracket] and
107 self.rawtext[self.bracketing[self.indexbracket][0]]
108 in ('"', "'"))
109
110 def is_in_code(self):
111 """Is the index given to the HyperParser in normal code?"""

Callers 2

open_completionsMethod · 0.95
test_is_in_stringMethod · 0.80

Calls

no outgoing calls

Tested by 1

test_is_in_stringMethod · 0.64