[XML-SIG] Re: Mr. Nitpicker looks at saxlib
Fredrik Lundh
fredrik@pythonware.com
Fri, 29 May 1998 14:29:29 +0100
(darn. sent this to the wrong mailing list. wonder if I can
disable that auto-fill feature of outlook express...)
some comments on some of LMG's comments; more will
follow later...
>| 2. Usability: There's no "feed" method.
> def feed(self,data):
> "Feeds data to the parser."
> raise saxlib.SAXException("Method not supported.",None)
don't forget the close method; sgmllib/xmllib/sgmlop uses
this to process what's left in the input buffers. and with the
accelerated versions of xmllib/sgmllib, you'll leak memory
if you don't explicitly call the close method.
>| 3. Performance: Is the AttributeList class really necessary? Wouldn't
>| it be enough to use a good ole dictionary?
>Using dictionaries would mean losing attribute type information. This
>is important to be able to identify the different attribute types. DOM
>will have to do this and many other kinds of system as well.
what exactly can be returned by the getType method? a string
describing the type? what values can it have? how should it
be used?
>Also, the current Python version of AttributeList has the added
>>advantage that it can be used like this:
>>
>>print "<%s" % name
>>for attr in attrs:
>> print " %s=%s" % (attr,attrs[attr])
for kv in attrs.items():
print "%s=%s" % kv
>>Then there's JPython integration and all that. IMHO AttributeList
>>should stay.
Well, I'm still sceptical...
>>Those who want all-out maximum overdrive __raw__ speed above
>>all else should not use SAX (or even Python) anyway.
Hey, everyone should use Python!
>>| 6. Usability: htmllib (!) provides save_bgn and save_end methods
>>
>>Well, this could be implemented in the extended drivers and might have
>>some advantages, but I personally don't really want this feature. Any
>>other opinions?
Nope. I wont miss them, at least.
>>| 7. Should the API be tweaked to adhere to the Python style
>>| guidelines?
>>
>>IMHO: no. It's too late now. I've got lots of code that uses this
>>style, you've got code that in it, the DOM has it, the tutorial uses
>>it, Paul Prescod has used it and probably many others.
OK.
>>| 9. Should sgmlop perhaps be renamed to xmlop?
>>
>>XML is SGML, so if you want to support both I think you should keep
>>the name.
Well, changing the name might help us cash in on all the XML hype...
But you're right, of course; I'll keep the current name.
Now back to VML.
Cheers /F
fredrik@pythonware.com
http://www.pythonware.com