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

Резултати

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

Пребарај: #digestion

当前筛选 #digestion清除筛选
STAR VET BOOKS

@starvetbooks · Post #4351 · 06.08.2024 г., 05:17

🐄🐄 𝘿𝙄𝙂𝙀𝙎𝙏𝙄𝙊𝙉 𝙄𝙉 🐄𝙍𝙐𝙈𝙄𝙉𝘼𝙉𝙏𝙎 🐄🐮 👉All herbivores (plant-eating mammals) are called ruminants. 👉They rechew the cud to break down plant matter and stimulate digestion. 👉The stomach is divided into four chambers- rumen, reticulum, omasum, and abomasum. 🐄🐮 𝙋𝙧𝙤𝙘𝙚𝙨𝙨 𝙊𝙛 𝘿𝙞𝙜𝙚𝙨𝙩𝙞𝙤𝙣 🐄🐮 👉Ruminants quickly swallow the food and store it in the rumen. 👉Once the rumen is filled, food is passed into the second chamber (reticulum). 👉In the reticulum, digestive juices partially digest the food. 👉Partially digested food is called cud. 👉Now when mammals are resting, bring the cud back into the mouth for rechewing. 👉After cud is chewed food is passed to the omasum and the abomasum. 👉Symbiotic bacteria in the caecum brought complete digestion of cellulose. #digestion https://t.me/starvetbooks

Hashtags

FenSloshes 🔞

@FenSloshes · Post #29 · 12.01.2020 г., 20:30

That's Better~ - #animation#soft#digestion 🎨https://www.furaffinity.net/gallery/elricmysteryshifter/ 🎥https://www.furaffinity.net/view/32597334/ 🎧https://www.furaffinity.net/view/34580255/

FenSloshes 🔞

@FenSloshes · Post #28 · 12.01.2020 г., 14:44

Espeon Wins (Internal) - #animation#soft#digestion 🎨https://www.furaffinity.net/gallery/elricmysteryshifter/ 🎥https://www.furaffinity.net/view/33080976/ 🎧https://www.furaffinity.net/view/34576234/

12
ПретходнаСтраница 1 од 2Следна