Hrvoje Niksic wrote: > How about: > > try: > ... code that can raise Thing or another exception ... > except Exception, e: > if isinstance(e, Thing): > # handle thing > # generic exception handling That is indeed the idiomatic way of handling the original poster's use case without nesting a second try block. Any proposals for new dedicated syntax should probably go to python-ideas rather than here though. (It's a rare enough use case that I don't like the original poster's chances of getting much support for changes though) Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia ---------------------------------------------------------------
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4