Is this a bug?

Carolina Feher mirrorball at interair.com.br
Tue Mar 9 17:15:46 EST 2004


>>> def f(a):
...     return 5
...
>>> class A(list):
...     g = f
...     def __new__(cls):
...             c = list.__new__(cls, [1, 2])
...             c.g()
...             return c
...
>>> a = A()
>>> a
[]

Why is an empty list returned?



More information about the Python-list mailing list