MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / __iter__

Method __iter__

test/functional/test_framework/script.py:500–518  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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):

Callers

nothing calls this directly

Calls 4

raw_iterMethod · 0.95
is_small_intMethod · 0.95
decode_op_nMethod · 0.95
CScriptOpClass · 0.85

Tested by

no test coverage detected