| 542 | raise NotImplementedError |
| 543 | |
| 544 | def __new__(cls, value=b''): |
| 545 | if isinstance(value, bytes) or isinstance(value, bytearray): |
| 546 | return super(CScript, cls).__new__(cls, value) |
| 547 | else: |
| 548 | def coerce_iterable(iterable): |
| 549 | for instance in iterable: |
| 550 | yield cls.__coerce_instance(instance) |
| 551 | # Annoyingly on both python2 and python3 bytes.join() always |
| 552 | # returns a bytes instance even when subclassed. |
| 553 | return super(CScript, cls).__new__(cls, b''.join(coerce_iterable(value))) |
| 554 | |
| 555 | def raw_iter(self): |
| 556 | """Raw iteration |