Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #25726
| Date | 2012-07-21 03:02 -0500 |
|---|---|
| From | Andrew Berg <bahamutzero8825@gmail.com> |
| Subject | Re: Basic question about speed/coding style/memory |
| References | <500A5B47.1060805@freenet.de> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2365.1342857760.4697.python-list@python.org> (permalink) |
On 7/21/2012 2:33 AM, Jan Riechers wrote: > Block > ... > versus this block: > ... > Now, very briefly, what is the better way to proceed in terms of > execution speed, readability, coding style? Using if/else is the most readable in the general sense. Using return (or break or continue as applicable) in this manner would indicate (at least to me) that it's an exceptional or otherwise special case and that the function can't do what it's supposed to. In that case, I would try to catch an exception rather than use if/else whenever possible. I highly doubt there is a significant performance difference between them. -- CPython 3.3.0b1 | Windows NT 6.1.7601.17803
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Basic question about speed/coding style/memory Andrew Berg <bahamutzero8825@gmail.com> - 2012-07-21 03:02 -0500
csiph-web