Accessing 'mangled' class attrbutes

danmcleran at yahoo.com danmcleran at yahoo.com
Wed Mar 1 11:50:24 EST 2006


>>Is there any simple way round this situation in general?

It might be safer to use composition instead of inheritance in this
case. Assuming that XMLWriter has a write method to write what you
want, you could hold a reference to an XMLWriter within your class and
pass along write command like:

writer = XMLWriter()
writer.write(stuff)




More information about the Python-list mailing list