Closed scott-griffiths closed 5 months ago
We could add something like this to the Dtype class:
def __call__(self, value) -> Bits: b = Bits() # TODO: Inefficient to create then set self.set_fn(b, value) return b
This would let you call a Dtype to create an object of that type:
>>> a = Dtype('uint12') >>> a(4095) Bits('0xfff')
This has ended up being the parse method, which should be in 4.2.
parse
We could add something like this to the Dtype class:
This would let you call a Dtype to create an object of that type: