[XML-SIG] xml.dom.minidom.Text no more __init__?

Fred L. Drake, Jr. fdrake at acm.org
Mon Mar 29 10:12:12 EST 2004

On Friday 26 March 2004 11:10 am, brett hartshorn wrote:
 > So does that mean that the Text class can not be subclassed?  Looks like
 > Text's parent class CharacterData has an __init__, i thought calling init
 > on Text would have been forwarded to its parent?

You certainly can subclass Text, but CharacterData does not have an __init__() 
either (else Text would inherit it).  Your subclass will need to either 
initialize the .data and .ownerDocument attributes in the __init__(), or 
you'll need to initalize them after construction.

I've added a comment to the source since this question comes up so frequently.


Fred L. Drake, Jr.  <fdrake at acm.org>
PythonLabs at Zope Corporation

More information about the XML-SIG mailing list