[XML-SIG] SAX 2.0 names

Fred L. Drake, Jr. fdrake@acm.org
Tue, 29 Feb 2000 10:31:05 -0500 (EST)


Lars Marius Garshol writes:
 >  - as objects (with __cmp__, __hash__, get_uri, get_local_name and
 >    get_rawname methods)
 > 
 >    - requires a bit of machinery in drivers to be effective
 >    - all operations will be slow
 >    - a natural way to model this

  If the objects are implemented as a C/Java extension type, it should
be plenty fast.  A 100% Pure Python implementation can be a fallback
if the extension isn't available.

 >  - as strings (of the form 'uri localname', with the rawname in a
 >    separate parameter)
 > 
 >    - comparison and indexing will be fast, especially with interned
 >      names 
 >    - decomposition will be slow and awkward
 >    - feels kind of like a hack

  Very much.

 >  - as tuples (of the form ('uri', 'localname'), with the rawname in a
 >    separate parameter)
 > 
 >    - all operations are convenient
 >    - comparison and indexing may not be as fast as with strings
 >    - a natural way to model this

  And the convenient tuple unpacking could also be provided using the
object approach; the objects can easily implement the sequence
protocol.
  I'd be willing to write a C implementation of the object version if
that's the API we decide on, but I'd also be fine with the third
option.


  -Fred

--
Fred L. Drake, Jr.	  <fdrake at acm.org>
Corporation for National Research Initiatives