def __new__(cls, data = None): """Create a new bytearray. data can be a string as per the array() constructor documentation.""" if data: return array.__new__(ByteArray, 'B', data) else: return array.__new__(ByteArray, 'B')
def __new__(cls, data=None): """Create a new bytearray. data can be a string as per the array() constructor documentation.""" if data: return array.__new__(ByteArray, 'B', data) else: return array.__new__(ByteArray, 'B')
def __new__(cls, name): size = pd.libpd_arraysize(name) if size < 0: raise ValueError('"%s" is not a valid array' %name) a = array.__new__(cls, 'f', range(size)) a.__name = name pd.libpd_read_array(a, name, 0, size) return a
def __new__(cls, dtype, default_value=None): if dtype == float: type_code = 'd' elif dtype == int: type_code = 'l' # 'q' not supported in Python 2 elif dtype == bool: type_code = 'B' # one-byte bools else: raise ValueError(dtype) uncasted_result = array.__new__(cls, type_code) if 1 or isinstance(uncasted_result, Array): result = uncasted_result return result
def __new__(cls, l): self = array.__new__(cls, 'd', range(l)) return self
def __new__(cls, loadedfile): return array.__new__(cls, 'B')
def __new__(cls, old=[], prefactor=1): return array.__new__(cls, 'i', old)
def __new__(cls, args=[0]*9): return array.__new__(cls, 'i', args)
def __new__(cls, x=0, y=0, z=0): return array.__new__(cls, 'd', (x,y,z))
def __new__(cls, data=""): """ Create a new bytearray. data can be a string as per the array() constructor documentation. """ return array.__new__(cls, 'B', data)
def __new__(cls, v="", implied=False): return array.__new__(cls, "c", str(v))
def __new__(cls, *args): if IS_PY3: return array.__new__(cls, "b", *[x.encode("ascii") for x in args]) else: return array.__new__(cls, "b", *args)
def __new__(cls): return array.__new__(cls, 'f', [0.0]*24)
def __new__(cls, data=None): if data: return array.__new__(BinArray, "B", data) else: return array.__new__(BinArray, "B")
def __new__(cls, matrix_array=(1,0,0,0,1,0,0,0,1,0,0,0)): return array.__new__(cls, 'd', matrix_array)
def __new__(cls, *args): return array.__new__(cls, "c", *args)
def __deepcopy__(self, memo): cls = self.__class__ return array.__new__(cls, 'd', (self[0],self[1],self[2]))
def __new__(cls, matrix_array=(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)): return array.__new__(cls, 'd', matrix_array)
def __new__(cls, x=0, y=0, z=0): return array.__new__(cls, 'd', (x, y, z))
def __new__(cls, v="", implied=False): return array.__new__(cls, 'c', "".join(v))
def __deepcopy__(self, memo): cls = self.__class__ return array.__new__(cls, 'd', (self[0], self[1], self[2]))
def __new__(cls): self = array.__new__(cls, 'd', range(256)) return self
def __new__(cls, args=[0] * 9): return array.__new__(cls, 'i', args)
def __new__(cls, w, h, typecode='d', data=None): self = array.__new__(cls, typecode) return self