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

Method set_is_dangerous

Lib/idlelib/squeezer.py:127–136  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

125 self.after_idle(self.set_is_dangerous)
126
127 def set_is_dangerous(self):
128 dangerous_line_len = 50 * self.text.winfo_width()
129 self.is_dangerous = (
130 self.numoflines > 1000 or
131 len(self.s) > 50000 or
132 any(
133 len(line_match.group(0)) >= dangerous_line_len
134 for line_match in re.finditer(r'[^\n]+', self.s)
135 )
136 )
137
138 def expand(self, event=None):
139 """expand event handler

Callers 2

expandMethod · 0.95

Calls 3

winfo_widthMethod · 0.80
anyFunction · 0.70
groupMethod · 0.45

Tested by 1