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 | ncogh...@gmail.com | Brisbane, Australia --------------------------------------------------------------- _______________________________________________ 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