
March 25, 2012
3:32 p.m.
On 2012-03-25, at 17:19 , Antoine Pitrou wrote:
On Sun, 25 Mar 2012 10:15:05 -0400 Calvin Spealman <ironfroggy@gmail.com> wrote:
What if we allowed this to be implied and except/else blocks bound to the previous statement? A try block would be an optional form, and mostly left for multi-block try's
r = some_single_statement() except TypeError: print "oh no!" raise OhNoException() else: p = prepare(r) print "I got", p
Saving one line and four non-whitespace characters? -1 from me.
Just the characters, since the single statement could be put on the same line as the try: try: r = some_single_statement() except TypeError: print "oh no!" raise OhNoException() p = prepare(r) print "I got", p