TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #402 · 22 дек.

Отдельно разберём TaskGroup, который пришел на замену gather в Python 3.11. Ключевые отличия ▫️create_task() возвращает объект asyncio.Task, у которого есть соответствюущие методы управления. То есть у нас больше контроля ▫️это контекстный менеджер, который гарантирует что все таски будут остановлены по выходу из контекста ▫️ошибка автоматически отменяет незавершенные задачи, ▫️except* передает нам ExceptionGroup, в котором каждую ошибку можно обработать отдельно import asyncio import random async def do_it() -> str: if random.random() < 0.1: raise ValueError('Oops') delay = random.uniform(0.5, 1.5) await asyncio.sleep(delay) return delay async def main(): try: async with asyncio.TaskGroup() as tg: for _ in range(10): tasks.append(tg.create_task(do_it())) for t in tasks: print(t.result()) except *ValueError as e: for err in e.exceptions: print(err) asyncio.run(main()) Рекомендую изучить страницу Coroutines and Tasks из документации, где представлено больше интересных примеров и механизмов - таймауты - отмена задач - создание задач из другого потока #async

Hashtags

Резултати

Пронајдени 2 слични објави

Пребарај: #blissrom

当前筛选 #blissrom清除筛选
Xiaomi 12T Pro | K50U | Updates

@xiaomi_12tpro_updates · Post #222 · 12.01.2025 г., 13:11

¡New build available! #A15#BlissRom Xiaomi 12T Pro / Redmi K50 Ultra (diting) Maintainer:@TeamMEX_XDA (Kισżż) Version:Bliss-v18.1-diting-UNOFFICIAL-gapps-20250112 Download Firmware Device Changelog: - Fix eSIM (forgot to add the wrapper) - Include the firmware again - Allow people to flash stuff via bliss recovery (you can still use ofox or twrp) - Fix Misight domain sepolicy issues - Implement rebased yuki kernel (again is fixed the issues on 12tPRO? ) - FW included - Feas support - FEAS: Code refactoring to improve efficiency and readability. '#BlissRom' '#Voyager' '#Bliss18.1' If you like my work and want to support it please consider making a donation this helps with server costs. Donate PayPal

Xiaomi 12T Pro | K50U | Updates

@xiaomi_12tpro_updates · Post #220 · 10.01.2025 г., 02:06

¡New build available! #A15#BlissRom Xiaomi 12T Pro / Redmi K50 Ultra (diting) Maintainer:@TeamMEX_XDA (Kισżż) Version:Bliss-v18.1-diting-UNOFFICIAL-gapps-20250109 Download Firmware Device Changelog: - Add Updater support - Yuki kernel updated - Enable smartpixels and disable it on udfps location - enable Screen off udfps support - use correct sensor for pocket mode - initial release for diting '#BlissRom' '#Voyager' '#Bliss18.1' If you like my work and want to support it please consider making a donation this helps with server costs. Donate PayPal Follow @xiaomi_12tpro_updates Join @xiaomi12tpro_chat