On 2011-09-11 13:17, Kayode Odeyemi wrote:
On Sun, Sep 11, 2011 at 11:41 AM, Thomas Jollans<t...@jollybox.de>  wrote:
 It is working:

 >>>  class A(object):
 ...     def log (self, module):
 ...         return str ('logged')
 ...
 >>>  class B(A):
 ...     def __init__(self, module):
 ...         self.module = A().log(module)
 ...
 >>>  c = B('system')
 >>>  c.module
 'logged'

Why do you have to do c.module? I'm expecting an output just by creating an
instance of B.

Why do you expect an output? In B.__init__ you are just assigning the return value from A.log() to the attribute "module" and in A.log() there is no output either.

Bye, Andreas

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to