Use of begin/end blocks is important to limit the lifetime of various objects. In particular, if a tangler is writing code to a named_file_sink, then the file will not be closed properly until it is destroyed.
349: #line 422 "input_frame.ipk" 350: def begin(self): 351: "Begin a block" 352: ho = self.head_offset 353: self.select(None) 354: inpt = input_frame( 355: self.pass_frame, 356: self.source, 357: [], 358: self.current_weaver, 359: self.userdict.copy(), 360: self.depth) 361: inpt.head_offset = ho 362: inpt.set_warning_character(python=self.python_warn) 363: inpt.file_pass() 364: 365: def end(self): 366: "end a block" 367: self.select(None) 368: raise eoi 369: