MCPcopy Index your code
hub / github.com/petertodd/python-bitcoinlib / __new__

Method __new__

bitcoin/core/script.py:544–553  ·  view source on GitHub ↗
(cls, value=b'')

Source from the content-addressed store, hash-verified

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

Callers 1

__new__Method · 0.45

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected