From d836c21f8aa6eac5751a1e3e88cb9ce9e4350b31 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 25 Dec 2009 06:13:14 +0100 Subject: [PATCH] aubio/__init__.py: simplify, add support for list input --- interfaces/python/aubio/__init__.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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) -- 2.26.2