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 слични објави

Пребарај: #englishcourse

当前筛选 #englishcourse清除筛选
BBC Learning English

@english_bbc_learning · Post #3801 · 10.12.2025 г., 19:05

😴🥱 Are you feeling tired? Do you need a short sleep to boost your energy levels? What word do British people say instead of ‘short sleep’? 💤⁣ ⁣ We’ll tell you the answer later! ⏰⁣ ⁣ MORE: Learn how important sleep is AND expand your vocabulary by clicking the link in our bio.⁣ ⁣ ⁣ #english#englishslang#englishvocabulary#learnenglish#englishwords#englishcourse

BBC Learning English

@english_bbc_learning · Post #3745 · 30.10.2025 г., 17:52

😴🥱 Are you feeling tired? Do you need a short sleep to boost your energy levels? What word do British people say instead of ‘short sleep’? 💤⁣ ⁣ We’ll tell you the answer later! ⏰⁣ ⁣ MORE: Learn how important sleep is AND expand your vocabulary by clicking the link in our bio.⁣ ⁣ ⁣ #english#englishslang#englishvocabulary#learnenglish#englishwords#englishcourse

Andijan Development Center

@adceducate · Post #7940 · 15.09.2023 г., 10:55

📢 Exciting News! 📢 Join our IELTS course with Teacher Danila Polikarpov! 📚✨ 🗓 When: Every Tuesday, Thursday, and Saturday 🕘 Time: 9:00 AM 📍 Where: Mashrab 19A (Hotel branch) 🌟 Why choose our IELTS course? ✅ Expert guidance from Teacher Danila ✅ Proven strategies for success ✅ Comprehensive test preparation ✅ Improve your English skills Don't miss this opportunity to boost your IELTS scores and achieve your goals! 🚀 Enroll today and take the first step towards your IELTS success. Limited seats available, so act fast! Contact us for more information or to reserve your spot. Our branches📍 📍Main office (A. Khaydarov 10) 📍Tennis court (Mashrab 19A) 📍Dialogue (Bobur Shokh 11) 📍Eski shahar (Cholpon Shokh 181) 📍Orange (Lomonosov 43) 📍School (Mangulik 14) If you have any questions, do not hesitate to contact us☎️ +998742261078 | +998742281121 | +998958505111 | +998742276163 | +998742252536 | +998952017878 or write on Telegram @admofadc 🔗 Follow ADC Andijan on social media: Telegram | Instagram | Facebook | Tik-Tok #IELTS#EnglishCourse#LearnEnglish#IELTSPreparation#SuccessInIELTS#TeacherDanila#JoinUsNow

BBC Learning English

@english_bbc_learning · Post #3725 · 21.10.2025 г., 16:30

What word do British people say instead of ‘police station’? 🚓🚨⁣ ⁣ We’ll tell you the answer later! 😄⁣ ⁣ MORE: Learn 5 slang words to talk about money with Sian by clicking the link in our bio! 💷🤑⁣ ⁣ (Image: Getty)⁣ ⁣ #english#englishteacher#englishlesson#learnenglish#englishonline#englishcourse#englishschool#englishvocabulary#slang#britishslang#englishgrammar