On 7/6/05, Thomas Lotze <[EMAIL PROTECTED]> wrote: > I want to ask what you think about introducing a keyword 'eltry' which > would be the counterpart of 'elif' for try statements. This had been > suggested before on python-list a couple of years ago by Jonathan > Gardner, but nothing (that I could find) seems to have come of it.
I'm -1 on this. The use case doesn't occur often in my experience and IMO putting each try statement in the else clause of the previous one is a fine solution. I also notice that your only example is very repetitive, and would be better written as a loop, using Python's dynamic nature: for decoder in foo_decode, bar_decode, foobar_decode: try: data = decoder(data) break except ValueError: print "data doesn't seem to be %s-encoded" % decoder.__name__ -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com