Python 3.11 -
Notice the except* (star-except) syntax. It catches all ValueErrors inside the group without breaking the successful execution of task "B". Ask any developer: "What is the worst part of Python?" Many will answer: Tracebacks that only tell you the line, not the column.
If you are starting a new project today, target . Your future self will thank you for the speed and clarity. Want to test it yourself? Install via pyenv or the official Python Docker image python:3.11-slim . python 3.11
# Python 3.10 Traceback (most recent call last): File "calc.py", line 2, in <module> result = 100 / (50 - 50) ZeroDivisionError: division by zero Traceback (most recent call last): File "calc.py", line 2, in <module> result = 100 / (50 - 50) ~~~~^~~~~~~~~~~~ ZeroDivisionError: division by zero Notice the except* (star-except) syntax