Hello everyone,
I have an odd problem. I know that in Python, kwargs follow args, so I checked for that and it's not the problem. What is the problem is this:
Fine:
def __init__(self, sample_rate, label=u"", data=[] ):
TypeError: __init__()
got multiple values for keyword argument 'data':
def __init__(self, sample_rate, data=[], label=u""):
The calling line that throws the error looks like this:
def __getslice__(self, start, stop):
return Channel(self.sample_rate, self.label, data=list.__getslice__(self,start,stop))
The full code:
class Channel(list):
sample_rate = 0
def __init__(self, sample_rate, data=[], label=u"" ):
list.__init__(self,data)
self.sample_rate = sample_rate
self.label = label
@property
def nyquist_rate(self):
return float(self.sample_rate) / 2.0
def __getslice__(self, start, stop):
return Channel(self.sample_rate, self.label, data=list.__getslice__(self,start,stop))
Thank you!