@trumpsear_tg · Post #2016 · 16.01.2026 г., 14:02
The leader of the Venezuelan opposition presented Trump with her Nobel Peace Prize. #venezuelan#opposition#nobel 👂More on Trump's Ear ⚠️
Hashtags
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
Пребарај: #venezuelan
@trumpsear_tg · Post #2016 · 16.01.2026 г., 14:02
The leader of the Venezuelan opposition presented Trump with her Nobel Peace Prize. #venezuelan#opposition#nobel 👂More on Trump's Ear ⚠️
Hashtags
@addisstandardeng · Post #21033 · 10.01.2026 г., 09:15
#Pope_Leo says ‘war is back in vogue’ in major address to global envoys Pope Leo XIV has said the prohibition on countries violating one another’s borders has been “completely undermined,” in an important speech to diplomats gathered in the #Vatican. The first #United_States-born pope, giving his debut “state of the world” address, expressed his concern about “escalating tensions” in the “#Caribbean Sea and the #American Pacific coast” while calling for the “will of the #Venezuelan people” to be respected, and a return to stability in the country. “War is back in vogue and a zeal for war is spreading,” Leo told ambassadors from across the globe gathered in the Vatican’s Apostolic Palace on Friday. “The principle established after the Second World War, which prohibited nations from using force to violate the borders of others, has been completely undermined.” Leo was speaking just less than a week after the...... https://edition.cnn.com/2026/01/09/europe/pope-leo-state-of-world-address-envoys-intl