MCPcopy Create free account
hub / github.com/LUX-Core/lux / __new__

Method __new__

test/functional/test_framework/script.py:699–708  ·  view source on GitHub ↗
(cls, value=b'')

Source from the content-addressed store, hash-verified

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

Callers 1

__new__Method · 0.45

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected