Exception as the primary error handling mechanism?
Steve Holden
steve at holdenweb.com
Wed Jan 6 10:47:05 EST 2010
Phlip wrote:
> On Jan 5, 8:49 pm, Steven D'Aprano
> <ste... at REMOVE.THIS.cybersource.com.au> wrote:
>
>>> (A related question - why can't I just go 'if record = method(): use
>>> (record)'. Why extra lines just to trap and assign the variable before
>>> using it?)
>> Because that idiom is responsible for probably the most common error in C
>> of all, at least one of the most common errors. Thank goodness Python
>> forbids such a dangerous construct.
>
> switching = for == is the "most common error in C"?
>
> I can't tell if you are joking.
Well, there's also the "indenting code without surrounding it by braces"
error, but y'all just keep defending the approach to programming that
*you* think is best. Just don't expect others to agree. The FAQ clearly
documents why Python is a statement-based, and not an expression-based,
language.
Me, I think Guido is a pretty good language designer, and while we've
had our differences I think that Python is a *much* better language than
C and most others.
regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
PyCon is coming! Atlanta, Feb 2010 http://us.pycon.org/
Holden Web LLC http://www.holdenweb.com/
UPCOMING EVENTS: http://holdenweb.eventbrite.com/
More information about the Python-list
mailing list