Cooked' iteration Returns either a CScriptOP instance, an integer, or bytes, as appropriate. See raw_iter() if you need to distinguish the different possible PUSHDATA encodings.
(self)
| 617 | yield (opcode, data, sop_idx) |
| 618 | |
| 619 | def __iter__(self): |
| 620 | """'Cooked' iteration |
| 621 | |
| 622 | Returns either a CScriptOP instance, an integer, or bytes, as |
| 623 | appropriate. |
| 624 | |
| 625 | See raw_iter() if you need to distinguish the different possible |
| 626 | PUSHDATA encodings. |
| 627 | """ |
| 628 | for (opcode, data, sop_idx) in self.raw_iter(): |
| 629 | if data is not None: |
| 630 | yield data |
| 631 | else: |
| 632 | opcode = CScriptOp(opcode) |
| 633 | |
| 634 | if opcode.is_small_int(): |
| 635 | yield opcode.decode_op_n() |
| 636 | else: |
| 637 | yield CScriptOp(opcode) |
| 638 | |
| 639 | def __repr__(self): |
| 640 | def _repr(o): |
nothing calls this directly
no test coverage detected