basic python questions

Paddy paddy3118 at netscape.net
Sun Nov 19 23:51:29 EST 2006


Bruno Desthuilliers wrote:
> And this would be still more informative (and not deprecated...):
>
> filename = '/tmp/foo'
> f = open(fliename)
>
> Catching an exception just to raise a less informative one is somewhat
> useless IMHO.

Except that in the 'artificial' environment of homework, you are marked
for what you *show* you know, Catching an exception shows that the
pupil considered that opening a file could throw an exception.
You would have to comment  that a try except block was considered, give
an example of correct usage, then why it was not used, to get
equivalent, (or slightly higher), marks.
 
(That was drilled into me so many times at school).

- Paddy.




More information about the Python-list mailing list