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

Резултати

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

Пребарај: #redbloodcells

当前筛选 #redbloodcells清除筛选
Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40363 · 19.12.2025 г., 15:00

A red blood cell count measures how many red blood cells are in a tiny drop of your blood (one microliter). Normal ranges: - Men: 4.0 to 5.9 million cells per microliter - Women: 3.8 to 5.2 million cells per microliter. To help you picture it: a microliter is about the size of a small grain of sand. Low counts may mean anemia. High counts may be from smoking or dehydration. [Read more] @googlefactss#Health#BloodTest#RedBloodCells#MedicalFacts

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40228 · 30.11.2025 г., 23:01

Human red blood cells live for about 120 days before macrophages efficiently clear 5 million per second, but the recognition mechanism remains a mystery. New research aims to solve this. 🔬🩸⏳ [Read more] @googlefactss #RedBloodCells#CellBiology#MedicalScience#Macrophages#ScienceFacts

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40142 · 20.11.2025 г., 19:00

The biconcave shape of red blood cells maximizes surface area for efficient oxygen exchange and allows flexibility to squeeze through tiny capillaries, crucial for health. Diseases can distort this shape, but new microfluidic tech helps detect these changes for better diagnosis. 🔬💉🩸 [Read more] @googlefactss #RedBloodCells#Biology#Health#Disease#Biomechanics#MedicalInnovation#ScienceFacts