Python 3.11
try:
raise ExceptionGroup("batch", [
ValueError("invalid input"),
TypeError("unexpected type"),
])
except* ValueError as group:
print("Value errors:", group)
except* TypeError as group:
print("Type errors:", group)