Re: Basic question about speed/coding style/memory
On 7/21/2012 2:33 AM, Jan Riechers wrote:
> 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
|All times are GMT. The time now is 10:44 AM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.