David Perlman wrote:
If I make a subclass of a built-in class, like this:
class mylist(list):
def __init__(self):
list.__init__(self)
Then it is valid for me to do this:
>>> x=mylist()
>>> x.hello=3
>>>
But I can't do this:
>>> y=list()
>>> y.hello=3
Traceback (most recent call l
2009/12/20 David Perlman :
> If I make a subclass of a built-in class, like this:
>
> class mylist(list):
> def __init__(self):
> list.__init__(self)
>
> Then it is valid for me to do this:
>
x=mylist()
x.hello=3
>
> But I can't do this:
>
y=list()
y.hello=3
> Tra
If I make a subclass of a built-in class, like this:
class mylist(list):
def __init__(self):
list.__init__(self)
Then it is valid for me to do this:
>>> x=mylist()
>>> x.hello=3
>>>
But I can't do this:
>>> y=list()
>>> y.hello=3
Traceback (most recent call last):
File "", line