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 слични објави

Пребарај: #starving

当前筛选 #starving清除筛选
MessageInABottle

@mib_messageinabottle · Post #6796 · 16.05.2024 г., 14:15

ZioNazi*** #Israeli"settlers"evil colonists are allowed by the #ZioNazi Israeli Government to destroy desperately needed humanitarian #aid coming from #Jordan to #Gaza. These sicko “civilians” are destroying vital food aid to a #starving population, which is literally facing famine conditions which have been created by the actions of those very same #ZioNazis, and all while literally laughing about it and obviously having fun. Getting the settlers to destroy the aid is a very evil and dishonest way for the #Zionist Israeli Government to deny aid to #Gaza while pretending to the International community that they are doing all they can to allow it in. --------- *** Anyone wondering why I usually refer to Zionists as "ZioNazis" ...... ........ well, now you know why!

BBC Learning English

@english_bbc_learning · Post #3724 · 17.10.2025 г., 12:23

🤩 Even if you don’t eat meat, you can still use this expression to say that you’re super-hungry! 😁 Write your answer in the comments and like and share this post! Do you have a similar expression in your language? 👇👇🤩⁣ ⁣ MORE: ⁉️Are you angry when you're hungry? There's an English expression for that! 😲 Click the link in our bio to find out what it is with ⏱️ 6 Minute English! ⁣ ⁣ Images: Getty⁣ #learnenglish#hungry#starving#horse#esl#efl#vocabulary#englishclass#phrases#expressions#idiom#learnenglish#britishenglish#informalenglish#slang ⁣