Asyncio Evolved: Enhanced Exception Handling with Python 3.11 TaskGroups

Junya Fukuda

Junya Fukuda

Develops "LOVOT", a family-like robot that promotes the ability to love, at GROOVE X, Inc. He has spoken at PyCon JP, DjangoCongress JP, EuroPython, and other events. As a community activity, he participates in the management of GeekLab Nagano. Co-author of "Python Practical Recipes (2022 Gijutsu Hyoron Co., Ltd.)". Translation of "Expert Python Programming - Fourth Edition". Likes beer, camping, and asyncio.

    摘要

    With the release of Python 3.11 in October 2022, PEP 654 "Exception Groups and except" was accepted, and asyncio.TaskGroup() was added. This enhancement of exception and cancellation handling has allowed asyncio to evolve more flexibly, addressing the existing issues with asyncio APIs, such as insufficient cancellation and exception handling in asyncio.gather. In this talk, I would like to discuss the problems of existing asyncio APIs and how the newly introduced asyncio.TaskGroup() solves these issues. Attendees will learn about the improved way of handling exceptions and cancellations using asyncio.TaskGroup(), enabling them to write more efficient and robust asynchronous code with Python 3.11.

    說明

    地點

    R0

    時間

    第一天 • 13:05-13:35 (GMT+8)

    語言

    英文演講

    層級

    中階

    分類

    最佳實踐與慣例