Simpler implementation of AttributesUnion for XML processing.
authorJamey Sharp <jamey@minilop.net>
Wed, 14 Jun 2006 00:11:56 +0000 (17:11 -0700)
committerJamey Sharp <jamey@minilop.net>
Wed, 14 Jun 2006 00:11:56 +0000 (17:11 -0700)
src/size.py

index 907f2b5..2e1c403 100755 (executable)
@@ -5,11 +5,10 @@ from xml.sax.xmlreader import AttributesImpl
 from xml.sax import make_parser
 import sys
 
-class AttributesUnion(AttributesImpl):
-       def __init__(self, base, **values):
-               baseitems = dict(base)
-               baseitems.update(values)
-               AttributesImpl.__init__(self, baseitems)
+def AttributesUnion(base, **values):
+       baseitems = dict(base)
+       baseitems.update(values)
+       return AttributesImpl(baseitems)
 
 class AnnotateSize(XMLFilterBase):
        types = {