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)
| 498 | yield (opcode, data, sop_idx) |
| 499 | |
| 500 | def __iter__(self): |
| 501 | """'Cooked' iteration |
| 502 | |
| 503 | Returns either a CScriptOP instance, an integer, or bytes, as |
| 504 | appropriate. |
| 505 | |
| 506 | See raw_iter() if you need to distinguish the different possible |
| 507 | PUSHDATA encodings. |
| 508 | """ |
| 509 | for (opcode, data, sop_idx) in self.raw_iter(): |
| 510 | if data is not None: |
| 511 | yield data |
| 512 | else: |
| 513 | opcode = CScriptOp(opcode) |
| 514 | |
| 515 | if opcode.is_small_int(): |
| 516 | yield opcode.decode_op_n() |
| 517 | else: |
| 518 | yield CScriptOp(opcode) |
| 519 | |
| 520 | def __repr__(self): |
| 521 | def _repr(o): |
nothing calls this directly
no test coverage detected