G
Gonçalo Rodrigues
Hi,
Ok, now I'm really confused. What is supposed
super(<class>, <subclass of class>)
to do?
My thought was that with the following setup:
.... def test(self):
.... return "I'm %r." % self
.... .... def test(self):
.... return "I'm a no one."
.... Traceback (most recent call last):
File "<interactive input>", line 1, in ?
AttributeError: 'super' object has no attribute 'test'
So far so good, object class (the super class of Test) defines no test
method so it barfs. But
<bound method Test2.test of <class '__main__.Test2'>>
Huh? shouldn't it return the *unbound* method test at class Test? And
more:
Traceback (most recent call last):
A bug? Or my perceptions on what super(<class>, <subclass of class>)
should do are totally mixed up?
With my best regards,
G. Rodrigues
Ok, now I'm really confused. What is supposed
super(<class>, <subclass of class>)
to do?
My thought was that with the following setup:
.... def test(self):
.... return "I'm %r." % self
.... .... def test(self):
.... return "I'm a no one."
.... Traceback (most recent call last):
File "<interactive input>", line 1, in ?
AttributeError: 'super' object has no attribute 'test'
So far so good, object class (the super class of Test) defines no test
method so it barfs. But
<bound method Test2.test of <class '__main__.Test2'>>
Huh? shouldn't it return the *unbound* method test at class Test? And
more:
Traceback (most recent call last):
A bug? Or my perceptions on what super(<class>, <subclass of class>)
should do are totally mixed up?
With my best regards,
G. Rodrigues