From: Paul Brossier Date: Fri, 25 Dec 2009 05:13:14 +0000 (+0100) Subject: aubio/__init__.py: simplify, add support for list input X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d836c21f8aa6eac5751a1e3e88cb9ce9e4350b31;p=aubio.git aubio/__init__.py: simplify, add support for list input --- diff --git a/interfaces/python/aubio/__init__.py b/interfaces/python/aubio/__init__.py index 85c71808..136848b1 100644 --- a/interfaces/python/aubio/__init__.py +++ b/interfaces/python/aubio/__init__.py @@ -3,9 +3,7 @@ from _aubio import * class fvec(numpy.ndarray): - def __init__(self, length = 1024, **kwargs): - super(numpy.ndarray, self).__init__(**kwargs) - def __new__(self, length = 1024, **kwargs): - self = numpy.zeros(length, dtype='float32', **kwargs) - return self + if type(length) == type([]): + return numpy.array(length, dtype='float32', **kwargs) + return numpy.zeros(length, dtype='float32', **kwargs)