On Thu, Jun 18, 2009 at 9:48 PM, Luis N wrote:
>>> I get an error "TypeError: 'rounding' is an invalid keyword argument
>>> for this function" on my list subclass.
>>>
>>> How might I subclass list without this error?
>>>
>>> This is the code:
>>>
>>> class SeriesList(list):
>>> def __new__(cls
On Fri, Jun 19, 2009 at 12:56 AM, bob gailer wrote:
>
> Luis N wrote:
>>
>> I get an error "TypeError: 'rounding' is an invalid keyword argument
>> for this function" on my list subclass.
>>
>> How might I subclass list without this error?
>>
>> This is the code:
>>
>> class SeriesList(list):
>>
Luis N wrote:
I get an error "TypeError: 'rounding' is an invalid keyword argument
for this function" on my list subclass.
How might I subclass list without this error?
This is the code:
class SeriesList(list):
def __new__(cls, *args, **kwargs):
series_list = list.__new__(cls, *arg
I get an error "TypeError: 'rounding' is an invalid keyword argument
for this function" on my list subclass.
How might I subclass list without this error?
This is the code:
class SeriesList(list):
def __new__(cls, *args, **kwargs):
series_list = list.__new__(cls, *args)
serie
> > > I'm trying to figure out how to subclass the list built-in.
>
> > You could do it e.g. like that:
> >
> > class Mylist (list):
> > def __init__(self, seq=None):
> > super(self.__class__, self).__init__(seq)
> > def __getslice__(self, start, stop):
> > return self.__cl
> Message: 2
> Date: Tue, 22 Feb 2005 13:53:44 +0100
> From: [EMAIL PROTECTED] (Karl Pfl?sterer )
> Subject: Re: [Tutor] subclassing list -- slicing doesn't preserve type
> To: tutor@python.org
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; char
Karl Pflästerer said unto the world upon 2005-02-22 07:53:
On 22 Feb 2005, [EMAIL PROTECTED] wrote:
I'm trying to figure out how to subclass the list built-in.
.>>> class my_list(list):
def __init__(self, sequence=None):
list.__init__(self, sequence)
self.spam = 1
Brian van den Broek wrote:
Hi all,
I'm trying to figure out how to subclass the list built-in.
.>>> class my_list(list):
def __init__(self, sequence=None):
list.__init__(self, sequence)
self.spam = 1
.>>> mine = my_list((1,2,3,4))
.>>> mine.append(42)
.>>>
On 22 Feb 2005, [EMAIL PROTECTED] wrote:
> I'm trying to figure out how to subclass the list built-in.
>
> .>>> class my_list(list):
> def __init__(self, sequence=None):
> list.__init__(self, sequence)
> self.spam = 1
>
> .>>> mine = my_list((1,2,3
Hi all,
I'm trying to figure out how to subclass the list built-in.
.>>> class my_list(list):
def __init__(self, sequence=None):
list.__init__(self, sequence)
self.spam = 1
.>>> mine = my_list((1,2,3,4))
.>>> mine.append(42)
.>>> mine
[1, 2, 3, 4,
10 matches
Mail list logo