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


Groups > comp.lang.python > #100434

Re: Try: rather than if :

From Ian Kelly <ian.g.kelly@gmail.com>
Newsgroups comp.lang.python
Subject Re: Try: rather than if :
Date 2015-12-14 16:12 -0700
Message-ID <mailman.0.1450134794.22044.python-list@python.org> (permalink)
References <CALyJZZViT33d8iob-5PoYnJOdPU2RzSzt3YAic_GRaAxN+wE1A@mail.gmail.com>

Show all headers | View raw


On Mon, Dec 14, 2015 at 3:38 PM, Vincent Davis <vincent@vincentdavis.net> wrote:
> In the code below try is used to check if handle has the attribute name. It
> seems an if statement could be used. Is there reason one way would be
> better than another?

http://www.oranlooney.com/lbyl-vs-eafp/

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Try: rather than if : Ian Kelly <ian.g.kelly@gmail.com> - 2015-12-14 16:12 -0700

csiph-web