try blocks in Python vs. C++

David LeBlanc whisper at oz.net
Thu Sep 5 20:07:21 EDT 2002


I think the biggest reason why try blocks aren't suggested for use in C++ is
that they increase code size substantially (as do some other nice features).

Try...except is good practice in Python IMO.

David LeBlanc
Seattle, WA USA

> -----Original Message-----
> From: python-list-admin at python.org
> [mailto:python-list-admin at python.org]On Behalf Of Roy Smith
> Sent: Thursday, September 05, 2002 16:54
> To: python-list at python.org
> Subject: try blocks in Python vs. C++
>
>
> I'm reading Stroustroup's C++ book, and came upon a piece of advice to
> avoid using try blocks.  I use try blocks a lot in Python and gather
> it's common practice among pythonistas.
>
> Is there something fundamentally different about try blocks in Python
> and C++ which makes them more attractive to use in one vs. the other?
> On the surface, they appear to be virtually identical in just about
> every respect.  Is it simply a cultural difference?  Or just the
> author's own personal style?
> --
> http://mail.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list