On 8/31/06, Greg Ewing <[EMAIL PROTECTED]> wrote: > One problem is that it doesn't seem to chain > all that well. Suppose you had three files to > try opening: > > open(name1) except (open(name2) except open(name3) if IOError) if IOError > > Maybe it would be better if the exception type > and alternative expression were swapped over. > Then you could write > > open(name1) except IOError then open(name2) except IOError then open(name3) > > Still rather unwieldy though. -0.7j, I think > (the j to acknowledge that this is an imaginary > proposal.:-) > > -- > Greg Ewing, Computer Science Dept, +--------------------------------------+ > University of Canterbury, | Carpe post meridiem! | > Christchurch, New Zealand | (I'm not a morning person.) | > [EMAIL PROTECTED] +--------------------------------------+
I considered the expr1 except exc_type then expr2 syntax, but it adds a keyword without much need to do so. But, I suppose that isn't a problem now that conditional expressions are in and then is already a keyword. I hereby upgrade this from imaginary proposal to real proposal status! _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
