exception handling in complex Python programs
Fredrik Lundh
fredrik at pythonware.com
Tue Aug 19 13:47:32 EDT 2008
Rafe wrote:
> Again, this is probably too simple to help, but the only way to ignore
> certain types of exceptions, as far as I know, is to catch them and
> pass.
> e.g. this ignores type errors...
>
> try:
> somethingBad()
> except TypeError, err:
> pass
> except Exception, err:
> raise TypeError(err)
so what kind of code are you writing where *type errors* are not
considered programming errors? (catching them and proceeding is one
thing, but catching them and ignoring them?)
I'd be really worried if I found that in a piece of source code I had to
maintain.
</F>
More information about the Python-list
mailing list