Pop a frame and return it. See frame_context() for documentation of fall_through and discard.
(self, can_skip: bool, fall_through: int, *, discard: bool = False)
| 425 | return changed |
| 426 | |
| 427 | def pop_frame(self, can_skip: bool, fall_through: int, *, discard: bool = False) -> Frame: |
| 428 | """Pop a frame and return it. |
| 429 | |
| 430 | See frame_context() for documentation of fall_through and discard. |
| 431 | """ |
| 432 | |
| 433 | if fall_through > 0: |
| 434 | self.allow_jump(-fall_through) |
| 435 | |
| 436 | result = self.frames.pop() |
| 437 | options = self.options_on_return.pop() |
| 438 | |
| 439 | if discard: |
| 440 | self.last_pop_changed = False |
| 441 | return result |
| 442 | |
| 443 | if can_skip: |
| 444 | options.insert(0, self.frames[-1]) |
| 445 | |
| 446 | self.last_pop_changed = self.update_from_options(options) |
| 447 | |
| 448 | return result |
| 449 | |
| 450 | @contextmanager |
| 451 | def accumulate_type_assignments(self) -> Iterator[Assigns]: |
no test coverage detected