Hacker News new | past | comments | ask | show | jobs | submit login

What’s wrong with the `except (Exception, OtherException):` syntax



The exception groups wrap multiple tasks. Each task can throw one exception. The group is capable of catching all of them. Before with asyncio, it would exit on first exception.

You're example is: "catch the first exception of either type (A,B)", exception groups are: "catch all exceptions, of either type (A,B)"




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: