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

TGINSIGHT SIMILAR POSTS

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

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

Функция asyncio.wait() это еще один способ вызвать множество асинхронных задач. Она работает в нескольких режимах. 1. Самый простой - ждем завершения всех задач async def main(): tasks = [asyncio.create_task(do_it(i)) for i in range(10)] done, pending = await asyncio.wait( tasks, return_when=asyncio.ALL_COMPLETED ) for task in done: try: print(task.result()) except Exception as e: print(e) Очень похоже на gather, но работает не так. ▫️возвращает не результаты, а два сета с объектами Task у которых можно забрать результат через task.result() если они в списке done ▫️не гарантирует порядок результатов так как оба объекта это set ▫️не выбрасывает исключение когда оно появляется, а сохраняет его в Task. Исключение появится когда попробуете забрать резултьтат. 2. Ждем завершения первой задачи, даже если там ошибка. async def main(): tasks = [asyncio.create_task(do_it(i)) for i in range(3)] done, pending = await asyncio.wait( tasks, return_when=asyncio.FIRST_COMPLETED ) # в done может быть несколько задач! for task in done: try: print(task.result()) except Exception as e: print(f"Fail: {e}") # Оставшиеся задачи в pending, как правило, нужно отменить, иначе они будут продолжать работать for task in pending: task.cancel() В сете done будут таски которые успели завершится, причем как успешно так и нет. 3. До первой ошибки. Тоже самое, но с аргументом FIRST_EXCEPTION done, pending = await asyncio.wait( tasks, return_when=asyncio.FIRST_EXCEPTION ) Функция завершается как только первая задача упадет с ошибкой. Учтите, что в любом случае done вы можете обранужить несколько задач, как с ошибками так и успешные. ↗️ Полный листинг примеров здесь #async

Hashtags

Резултати

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

Пребарај: #regeneration

当前筛选 #regeneration清除筛选
Interesting Planet 🌍

@interesting_planet_facts · Post #1267 · 01.02.2026 г., 22:11

🌎 The axolotl, a salamander native to Mexico, can regenerate entire limbs, spinal cord, heart tissue, and even parts of its brain. Unlike most amphibians, axolotls remain aquatic and gilled for their whole lives due to a trait called neoteny. ✨ #axolotl⚡#regeneration⚡#amphibians 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #521 · 08.08.2025 г., 13:22

🌎 The axolotl, native to Mexico’s lakes, can regrow lost limbs, parts of its heart, and even sections of its brain. This “walking fish” stays forever young, never fully transforming into adulthood—a rare phenomenon called neoteny. ✨ #axolotl⚡#regeneration⚡#neoteny 👉subscribe Interesting Planet

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40864 · 27.03.2026 г., 07:01

Axolotls, also known as Ambystoma mexicanum, get their name from the Aztec language Nahuatl, meaning "water monster" or "water god." According to legend, they are the earthly form of Xolotl, the Aztec god who transformed into a salamander to avoid sacrifice. These creatures are famous for regenerating limbs, hearts, and even parts of their brains. They stay in their juvenile form for life, a trait called neoteny. In the wild, axolotls are critically endangered, with fewer than 1,000 left in Mexico’s Xochimilco and Chalco lakes. Habitat loss, pollution, and invasive species like tilapia are major threats. Conservation efforts are underway to restore their habitat and protect them from extinction. 🦎🌍💧 [Read more] If you have one as a pet, feel free to share with us! @googlefactss #Axolotl#WaterGod#EndangeredSpecies#Regeneration#Neoteny#Conservation#Wildlife#Mexico#Amphibians