RE: new except syntax in interim release 656
"Mark Hahn" <[email protected]>
| Newsgroups | gmane.comp.lang.prothon.user,gmane.spam.detected |
|---|---|
| Message-ID | <000201c45944$c86d21e0$0b01a8c0@mark> |
> From: Paul Prescod > Pretty good. But did you consider: > > except label = ExceptionObject1 or ExceptionObject2 > > Or how about > > try: > ~ ... > except ExceptionObject1 or ExceptionObject2 as label: > ~ ... > > I kind of like that! I must admit that "as" is already in the language. I was just trying to make minimum change to Python. I guess you could argue that keeping the label last is less change. I guess the least change would just be replacing the comma with "as": except (ExceptionObject1, ExceptionObject2) as label: This would not only be less change but it wouldn't be introducing the weird new expression logic of combining "or" with "as" :-) Comments?