[Python-Dev] Assertions

Greg Stein gstein@lyra.org
Tue, 21 Nov 2000 22:33:03 -0800


By definition, isn't minidom supposed to be cheap/easy/quick? The quick
answer to a problem?

If somebody wants an exception-conforming DOM implementation with all the
bells and whistles, then they can go elsewhere. If minidom starts getting
loaded up, then it has kind of defeated its purpose, no?

Cheers,
-g

On Tue, Nov 21, 2000 at 08:13:22PM -0800, Paul Prescod wrote:
> Tim Peters wrote:
> > 
> >...
> >
> > Why not?  I don't see any real difference between a core dump and an
> > uncaught & unexpected Python exception:  in either case the program didn't
> > get the job done, and left stuff in an unknown state.  
> 
> A core dump would kill Zope, PythonWin, Alice etc. An exception does
> not. To me, that's a big difference. Also, Py_Object type checks are
> extremely cheap in C code. And once we put in the parameter checks the
> user will get an unexpected Python exception. Presumably they are not
> building faulty XML trees on purpose!
> 
> Anyhow, I am won over despite your unpersuasive argument.
> 
> I note that minidom will not always give you an exception for a poorly
> formed tree. That means that the programmer may not find her error until
> the XML is "out of Python's hands." It should give an exception sooner
> or later but not never.
> 
>  Paul Prescod
> 
> _______________________________________________
> Python-Dev mailing list
> Python-Dev@python.org
> http://www.python.org/mailman/listinfo/python-dev

-- 
Greg Stein, http://www.lyra.org/