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)
| 753 | yield (opcode, data, sop_idx) |
| 754 | |
| 755 | def __iter__(self): |
| 756 | """'Cooked' iteration |
| 757 | |
| 758 | Returns either a CScriptOP instance, an integer, or bytes, as |
| 759 | appropriate. |
| 760 | |
| 761 | See raw_iter() if you need to distinguish the different possible |
| 762 | PUSHDATA encodings. |
| 763 | """ |
| 764 | for (opcode, data, sop_idx) in self.raw_iter(): |
| 765 | if data is not None: |
| 766 | yield data |
| 767 | else: |
| 768 | opcode = CScriptOp(opcode) |
| 769 | |
| 770 | if opcode.is_small_int(): |
| 771 | yield opcode.decode_op_n() |
| 772 | else: |
| 773 | yield CScriptOp(opcode) |
| 774 | |
| 775 | def __repr__(self): |
| 776 | # For Python3 compatibility add b before strings so testcases don't |
nothing calls this directly
no test coverage detected