ref: d836c21f8aa6eac5751a1e3e88cb9ce9e4350b31
parent: b8aaaffd5014ba0fe31d13d78255b74598cfd6eb
author: Paul Brossier <piem@piem.org>
date: Fri Dec 25 01:13:14 EST 2009
aubio/__init__.py: simplify, add support for list input
--- a/interfaces/python/aubio/__init__.py
+++ b/interfaces/python/aubio/__init__.py
@@ -3,9 +3,7 @@
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)