[XML-SIG] SAX 2.0 names

THOMAS PASSIN tpassin@idsonline.com
Tue, 29 Feb 2000 21:10:42 -0500

Fred L. Drake, Jr. wrote-
>  > In earlier posts I suggested tuples.  Fred and Lars' posts seem to be
>  > that tuples shouldn't cause a bug performance hit, and that could
>  > be finessed anyway.  Have I summarized what you have said correctly,
>  > and Lars?
>   That's my interpretation.
>  > Then I think we should go with tuples, because
>  > 1) They are easy for a non-expert Python programmer to understand and
>  > with,
>  > 2) they capitalize on a Python strength (nice data structures),
>  > 3) an expert can make them perform even better with extension modules,
>  > 4) as Fred said, if the extension module were not available one could
>  > back to a 100% Python implementation with practically no changes to
>  > code.
>   The "object" I imagine has three attributes: namespace URI,
> localpart, and prefix.  It would unpack to two values: URI &
> localpart, and comparisons would only operate on those two as well.

This sounds much like my original proposal for a nested tuple. Perhaps
((localname,uri),prefix).  Lars pointed out that the java SAX2 people seem
to want the raw name - I'm not convinced since you need the namespace to
confirm what the localname is supposed to mean, not the rawname.
Comparisons are very easy.  Will a nested tuple drag down performance a lot
more than a plain tuple?  Again, I think that say, a one or two percent
decrease in real-life usage is nothing to worry about.

>   The advantage is that we get the prefix for those who want it,
> single object comparisons, and no extraneous parameters to the call.
> I don't think *this* is available using the non-object approaches.
> Whether the objects are extension types or classes is irrelevant to
> this.
Tom Passin