| 697 | raise NotImplementedError |
| 698 | |
| 699 | def __new__(cls, value=b''): |
| 700 | if isinstance(value, bytes) or isinstance(value, bytearray): |
| 701 | return super(CScript, cls).__new__(cls, value) |
| 702 | else: |
| 703 | def coerce_iterable(iterable): |
| 704 | for instance in iterable: |
| 705 | yield cls.__coerce_instance(instance) |
| 706 | # Annoyingly on both python2 and python3 bytes.join() always |
| 707 | # returns a bytes instance even when subclassed. |
| 708 | return super(CScript, cls).__new__(cls, b''.join(coerce_iterable(value))) |
| 709 | |
| 710 | def raw_iter(self): |
| 711 | """Raw iteration |