![]() ![]() Sentry is currently evaluating how best to represent exception groups in Python and other languages. This now allows different coroutines to error in different ways and all the different exceptions will be collected into an ExceptionGroup, allowing you to handle each exception separately. ![]() Exception groups are similar to task groups in that they give a new way to represent exceptions in asyncio. There’s a lot here, so we’re going to split this up into sections: Exception groupsįirst up are exception groups. Improvements to Exceptionsīeing an error and performance monitoring company, we’re of course, very excited about the improvements to exceptions in 3.11. The task group causes all tasks to run to completion before the context exits, giving you much more flexibility. create_task (f1 (i ) ) print ( 'done' ) return 0. TaskGroup ( ) as tg : # you can do loops, conditions, etc for i in range ( 5 ) : async def amain ( ) - > int : # new, nice way of doing this! async with asyncio.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |