Comparison with False - something I don't understand
Harishankar
v.harishankar at gmail.com
Fri Dec 3 12:32:12 EST 2010
On Thu, 02 Dec 2010 17:33:47 -0800, Aahz wrote:
> Please demonstrate that using ``if`` blocks for True/False is impler and
> cleaner than using ``try`` blocks to handle exceptions.
It is my personal preference and coding style for certain situations I
encounter in my own programs and not something that I could prove to
anybody else by theory.
But anyway, in certain circumstances, exceptions create a break in flow
of the execution of a program that makes it non-obvious as to how to
resume flow at the point of disruption especially when the exception
handling mechanism is at a higher level. While an error flag can simply
set an alarm and allow other code to continue and allow the calling
higher-level code to handle the alarm/flag as it sees fit.
--
Harishankar (http://harishankar.org http://lawstudentscommunity.com)
More information about the Python-list
mailing list