classes riddle

inhahe inhahe at gmail.com
Mon Oct 19 13:19:17 EDT 2009


Can somebody clear this up for me?
------

Class B(A): def __init__(self, a) A.__init__(a) self.a = a a = A() ba = B(a)
bc = B(a) bd = B(a) ------ I'm not sure what A.__init__ here does. I would
think its __init__ is designed specifically to run once for any given
object.. so i'm not sure what happens. and if A calls self.blah(), which
instance of B which overrides blah gets called?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20091019/b1811d4f/attachment.html>


More information about the Python-list mailing list