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

Резултати

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

Пребарај: #riddle

当前筛选 #riddle清除筛选
Language Trivia 🤔

@languagetrivia · Post #536 · 24.12.2024 г., 06:00

🦫 Riddle: This 🇬🇧 British beaver is holding a mystery vegetable. What would he say he is holding? Options: A) Zucchini B) Courgette C) Cucumber D) Turnip E) Aubergine Press the button below to see the right answer. Did you guess it right? Yes 😎 | No 🌚 @languagetrivia#riddle

Hashtags

Language Trivia 🤔

@languagetrivia · Post #245 · 28.10.2024 г., 19:11

🧩 Riddle I’m a language spoken in a country known for its temples and street food. Written with a beautiful, looping script with no spaces between words. I use five tones to change the meaning of a word. What language am I? #guess_the_language#riddle 🦫@languagetrivia

Ask Me

@askmenow · Post #2871 · 07.03.2021 г., 11:59

1. One Light Year is equal to? Ans . the distance traveled by light in one year 2. Liquefied petroleum gas (LPG) is mainly a mixture of ___? Ans . propane and butane 3. The Ozone layer lies in the which layer? Ans . Stratosphere 4. Most of the light rays inside a tubelight is in the form of____? Ans . ultra -violet light 5. Which is the alkalodid that contains in cola drinks? Ans . Caffeine 6. The device used for detecting even feeble current: Ans . Galvanoscope Via @askmenow ------------------------------ #Idiom "When pigs fly" What it means?Check Answer #Riddle What has a thumb and four fingers, but is not a hand" What is it?Check Answer ------------------------------- For Fun: Be Like Bro & sarcasticLOL Today's Quiz MCQ:Quiz MCQ

Ask Me

@askmenow · Post #2858 · 12.02.2021 г., 17:47

Daily Questions and Answers 1. ‘Mechanical Clock’ made by whom? Ans . Isaac Newton 2. By which Cotton fibers are made? Ans . Cellulose 3. What is the name of the tube which connects the middle ear with the throat? Ans . Eustachian tube Via @askmenow #Idiom " A slap on wrist " What it means?Check Answer #Riddle "I’m tall when I’m young, and I’m short when I’m old" What am I?Check Answer

Ask Me

@askmenow · Post #2857 · 11.02.2021 г., 06:59

1. What is the speed of Earth around sun? Ans . 30 km/sec 2. In our solar system the MARS is fourth planet according to sequences but how many moons has ‘Planet MARS’? Ans . 2 3. To measure the Humidity in air, what instrument used? Ans . Hygrograph 4. Splitting of light into its constituent colors is known as what? Ans . Dispersion 5. Basically the heavy water is used by which type of industries? Ans . Nuclear Power Generation plants Via @askmenow #Riddle "What belongs to you but is used most by other people" What is it?Check Answer #Idiom "The ball is in your court" What it means?Check Answer For fun: SarcasticLOL & Be Like Bro Today's news headline: read here

Ask Me

@askmenow · Post #2854 · 08.02.2021 г., 18:23

Daily Questions and Answers 1. Where is Hagia Sophia located? Answer: Istanbul, Turkey 2. Which region can be called the belt of Doldrums? Answer: Equatorial region 3. What is the study of landforms called? Answer: Geomorphology Via @askmenow #Idiom "Blood is thicker than water" What it means?Check Answer #Riddle "What's so fragile that it breaks when you speak it" What is it?Check Answer Today's News headlines:read here Try: Quiz MCQ For Fun:Be Like Bro , sarcasticLOL

Language Trivia 🤔

@languagetrivia · Post #368 · 22.11.2024 г., 16:31

Why does Burmese (the language spoken in Myanmar, formerly Burma) use rounded characters instead of straight lines? Take the quiz below to find out! @languagetrivia#riddle#image

Anatomy Art Hub ☮️

@anatomyarthub · Post #5043 · 28.04.2025 г., 05:34

#загадка#riddle 6️⃣ Моя спина такая заботливая — она всегда напоминает мне, когда я старею... особенно, когда я просто чихнул. My back is so caring - it always reminds me when I'm getting old... especially when I just sneeze. @anatomyarthub

Anatomy Art Hub ☮️

@anatomyarthub · Post #4182 · 29.12.2024 г., 06:38

#загадка#riddle 5️⃣ Нормальная длина ног - когда ноги достают до пола. Так что это за мышца? Normal leg length is when your legs reach the floor. So what is this muscle? @anatomyarthub

123•••1011
ПретходнаСтраница 1 од 11Следна