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

Method comment_region_event

Lib/idlelib/format.py:288–298  ·  view source on GitHub ↗

Comment out each line in region. ## is appended to the beginning of each line to comment it out.

(self, event=None)

Source from the content-addressed store, hash-verified

286 return "break"
287
288 def comment_region_event(self, event=None):
289 """Comment out each line in region.
290
291 ## is appended to the beginning of each line to comment it out.
292 """
293 head, tail, chars, lines = self.get_region()
294 for pos in range(len(lines) - 1):
295 line = lines[pos]
296 lines[pos] = '##' + line
297 self.set_region(head, tail, chars, lines)
298 return "break"
299
300 def uncomment_region_event(self, event=None):
301 """Uncomment each line in region.

Callers

nothing calls this directly

Calls 2

get_regionMethod · 0.95
set_regionMethod · 0.95

Tested by

no test coverage detected