Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #100443 > unrolled thread

Re: Try: rather than if :

Started byVincent Davis <vincent@vincentdavis.net>
First post2015-12-14 17:20 -0700
Last post2015-12-14 17:20 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Try: rather than if : Vincent Davis <vincent@vincentdavis.net> - 2015-12-14 17:20 -0700

#100443 — Re: Try: rather than if :

FromVincent Davis <vincent@vincentdavis.net>
Date2015-12-14 17:20 -0700
SubjectRe: Try: rather than if :
Message-ID<mailman.9.1450138879.22044.python-list@python.org>
On Mon, Dec 14, 2015 at 4:53 PM, Ian Kelly <ian.g.kelly@gmail.com> wrote:

>
> Except that catching an exception just to immediately re-raise it is
> silly. This would be better:
>
> try:
>     name = handle.name
> except AttributeError:
>     pass
> else:
>     handle.write("# Report_file: %s\n" % name)


​Ya that would be silly.

Thanks​ everyone for the education.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web