@dragonarmor · Post #293 · 01.02.2022 г., 03:49
#mecha#dragon https://twitter.com/BastionBitch/status/1487975299568455682
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
Пребарај: #mecha
@dragonarmor · Post #293 · 01.02.2022 г., 03:49
#mecha#dragon https://twitter.com/BastionBitch/status/1487975299568455682
@SeriesClubHD · Post #2974 · 12.05.2026 г., 17:00
📺 - CODE GEASS - 📺 Título Original: Code Geass: Lelouch of the Rebellion Título Original: Code Geass: Lelouch el de la Rebelión Género:#Mecha#Acción#Drama#Política#CienciaFicción Temporadas: 2 📼 Año: 2006 - 2008 Origen: Japón 🇯🇵 Tráiler:youtu.be/2WaWhXoBNcc Saga:Sí✅ Sinopsis: En un mundo dominado por el Imperio de Britannia, Lelouch Lamperouge obtiene el poder del “Geass”, que le permite controlar a cualquiera con una orden. Con este don, decide liderar una rebelión contra el imperio, enfrentando dilemas éticos, batallas épicas y el peso de sus decisiones en la lucha por la libertad. Disponible:Crunchyroll | Netflix @SeriesClubHD
@dragonarmor · Post #207 · 13.06.2021 г., 06:41
#index#mecha#anthro https://twitter.com/protoBASILISK/status/1402058879048073216/photo/1
@dragonarmor · Post #193 · 07.06.2021 г., 07:25
#index#mecha#anthro https://twitter.com/Zhek0_AD/status/1350233869702885384?s=19
@dragonarmor · Post #192 · 07.06.2021 г., 07:25
#index#mecha#anthro https://twitter.com/Zhek0_AD/status/1353332425909272576?s=19
@dragonarmor · Post #139 · 14.04.2021 г., 10:52
#index#anthro#mecha https://twitter.com/Zhek0_AD/status/1372206622097948678?s=19
@dragonarmor · Post #127 · 04.04.2021 г., 13:55
#index#anthro#mecha https://e621.net/posts/2412194
@dragonarmor · Post #111 · 21.03.2021 г., 13:06
#index#mecha#anthro https://twitter.com/ishibashiyosuke/status/1373235200264605700?s=19
@dragonarmor · Post #99 · 12.03.2021 г., 08:34
#index#anthro#mecha https://www.pixiv.net/artworks/58797464
@dragonarmor · Post #97 · 12.03.2021 г., 08:34
#index#anthro#mecha https://twitter.com/NkmR8/status/1369277952010031113/photo/1
@dragonarmor · Post #83 · 27.02.2021 г., 13:54
#index#mecha#anthro https://twitter.com/jyabaryu/status/1357393843562237953/photo/1
@dragonarmor · Post #81 · 27.02.2021 г., 13:51
#index#mecha#anthro https://e621.net/posts/1075082