def __init__(self, buf=None, length=0):
        if isinstance(buf, list):
            items = buf
            buf = None
        else:
            items = None
        if buf is not None:
            if IS_PYPY:
                buf = create_string_buffer(str(buf))
            if isinstance(buf, buffer):
                address = c_void_p()
                buf_length = c_size_t()
                pythonapi.PyObject_AsReadBuffer(py_object(buf),
                                                byref(address),
                                                byref(buf_length))
                buf_length = buf_length.value
                buf = address
            buf = cast(buf, FloatPtr)
        self._ptr = Gauged.array_import(buf, length)
        FloatArray.ALLOCATIONS += 1
        if self._ptr is None:
            raise MemoryError
        if items is not None:
            for item in items:
                self.append(item)
Create a new array. The constructor accepts a buffer + byte_length
dataset/ETHPy150Open chriso/gauged/gauged/structures/float_array.py/FloatArray.__init__