canonical file access pattern?

John J. Lee jjl at pobox.com
Thu Jan 1 13:59:03 EST 2004


Hans-Joachim Widmaier <hjwidmaier at web.de> writes:
> Am Wed, 31 Dec 2003 14:51:01 +0000 schrieb John J. Lee:
[...]
> > If that were true, why did exceptions get invented?  If you don't need
> > to do something different in all those except: clauses, then don't put
> > them in. 
> 
> One thing I need is to create an informative and useful error message

.strerror?

[...]
> Hmm. The farther away from the actual point of error you catch it, the
> harder it is to tell exactly what happened and to redo/work around it.
[...]

So in some cases, you have fewer except statments, in others, more.
There's really no "canonical pattern" to it.


John



More information about the Python-list mailing list