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)
| 534 | yield (opcode, data, sop_idx) |
| 535 | |
| 536 | def __iter__(self): |
| 537 | """'Cooked' iteration |
| 538 | |
| 539 | Returns either a CScriptOP instance, an integer, or bytes, as |
| 540 | appropriate. |
| 541 | |
| 542 | See raw_iter() if you need to distinguish the different possible |
| 543 | PUSHDATA encodings. |
| 544 | """ |
| 545 | for (opcode, data, sop_idx) in self.raw_iter(): |
| 546 | if data is not None: |
| 547 | yield data |
| 548 | else: |
| 549 | opcode = CScriptOp(opcode) |
| 550 | |
| 551 | if opcode.is_small_int(): |
| 552 | yield opcode.decode_op_n() |
| 553 | else: |
| 554 | yield CScriptOp(opcode) |
| 555 | |
| 556 | def __repr__(self): |
| 557 | def _repr(o): |
nothing calls this directly
no test coverage detected