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

Threaded or asynchronous tasks can have multiple exceptions result from a single source event, think 2/5 tasks having a problem. Currently there’s a few library specific ways to handle this and the Python team want to standardise.



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: