[XML-SIG] Re: PyExpat update

Fred L. Drake, Jr. fdrake@acm.org
Tue, 8 Feb 2000 09:38:45 -0500 (EST)

Paul Prescod writes:
 > Well, why use numbers? The numbers are meaningless. Strings are at least
 > meaningful for some percentage of the world.

  If they are identifiers, they are meaningless regardless.  They can
only be used as messages if they are natural language, which doesn't
appeal to me.
  As long as they're identifiers, I think it's fine for them to be
strings; I really am not *advocating* the use of numbers.  I do think
that API changes to a known-working module need to be justified in
some way.

 > They are both messages and identifiers. As you can see above they can be
 > used as "dumb" identifiers (just like the integers) and they can be used
 > as strings if you happen to want to output English error messages (which
 > will be the case in the vast majority of situations just because most
 > programmers are too lazy/busy to localize).

  What I'm disturbed by is the conflation of use.  I'd rather see some 
identifier be used and let the user take care of *all* messages
provided to the user.  A "default" set of English messages can (and
should) be provided, but it's better to ask the client code to perform 
some transformation (dictionary lookup, whatever the guise); this
allows better flexibility both for application writers and for future
maintainers of the pyexpat module.

 > On second thought, instead of a dictionary I'll use an instance so that
 > you can say 
 > if rv == errors.XML_ERROR_SYNTAX:
 >   ...

  That's a bit nicer.  I'm not sure that the namespace needs to be
separated from the module namespace, but I don't object, either.


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