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

Резултати

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

Пребарај: #cityholder

当前筛选 #cityholder清除筛选
🏆 Premium, NFT, Tokens

@giiveaways · Post #3395 · 27.12.2024 г., 20:22

CITY Holder: Welcome to the country! Join us at DROGON!🐉 Let's build the best country in the simulation and compete for a prize of 1000 TON🤑 👉 @cityholderdrogon city 👈 #cityholder

Hashtags

🏆 Premium, NFT, Tokens

@giiveaways · Post #3316 · 29.11.2024 г., 15:38

🗓Combo of the Day: 29.11.2024 💰 In #CityHolder, you get +7,500,000 coins every day for the Combo of the Day! The combo is updated at 2:00 PM. Tg Today's Combo: ✅Country Cottage -Residential buildings ✅Old Town - Residential buildings ✅HistoricMansion -Residential buildings ❓How to collect the combo in City Holder? Go to @CityHolder. Open the "Construction" section. Select the required combo cards. 👉 Join @CityHolder! #CityHolder

Hashtags

🏆 Premium, NFT, Tokens

@giiveaways · Post #3307 · 23.11.2024 г., 18:52

🗓Combo of the Day: 23.11.2024 💰 In #CityHolder, you get +7,500,000 coins every day for the Combo of the Day! The combo is updated at 2:00 PM. Today's Combo: ✅ Shopping Center ✅ Business Center ✅ Shopping Arcade ❓How to collect the combo in City Holder? Go to @CityHolder. Open the "Construction" section. Select the required combo cards. Daily Quiz 23.11.2024 👇 1. What is the type of the cryptocurrency designed to ensure price stability? Answer: Stablecoin 2. Which city is considered the cultural capital of Russia? Answer: Saint Petersburg 3. Which musical instrument was invented by Italians? Answer: Mandolin 4. In what year did Bitcoin appear? Answer: 2009 5. In which country is Kruger National Park located? Answer: South Africa 6. Which of these dishes is a national dish of Malaysia? Answer: Satay 7. Which dance style originated in Brazil? Answer: Samba 8. What is the official language of Brazil? Answer: Portuguese 9. Which city hotel is known as the most luxurious in the world? Answer: Burj Al Arab 10. What is the name of the Kyrgyz national epic? Answer: Manas 👉 Join @CityHolder! #CityHolder

Hashtags

🏆 Premium, NFT, Tokens

@giiveaways · Post #3304 · 22.11.2024 г., 16:04

🗓Combo of the Day: 22.11.2024 💰 In #CityHolder, you get +7,500,000 coins every day for the Combo of the Day! The combo is updated at 2:00 PM. Today's Combo: ✅ Agrocomplex - Industrial facilities ✅ Fish Farm - Industrial facilities ✅ Mill - Industrial facilities ❓How to collect the combo in City Holder? Go to @CityHolder. Open the "Construction" section. Select the required combo cards. Quiz 👇 1. / Guatemala 2. / Goulash 3. / SHA- 256 4. / Milan 5. / Indians 6. / Complete anonymity 7./ Jordan 8. / Juhannus 9. / Evan Duffield 10. / Genesis Block 👉 Join @CityHolder! #CityHolder

Hashtags

🏢 Daily Quiz :16 Jul 🔑Q.1 Ans. :GPS 🔑Q.2 Ans. :Bluetooth 🔑Q.3 Ans. :Miso soup 🔑Q.4 Ans. :Magnetometry 🔑Q.5 Ans. :Malay Archipelago 🔑Q.6 Ans. :Isaac Asimov 🔑Q.7 Ans. :Spacewar! 🔑Q.8 Ans. :Rigoletto 🔑Q.9 Ans. :Johannes Gutenberg 🔑Q.10 Ans. :Friedrich Schiller 🔗 Link :City Holder #cityholder ❤️ If you appreciate our work, tap a like or heart to support — we’ll keep bringing top passive income projects!

Hashtags

🏢 Daily Quiz :15 Jul 🔑Q.1 Ans. :Astana 🔑Q.2 Ans. :Sodium 🔑Q.3 Ans. :Hogwarts 🔑Q.4 Ans. :Haruki Murakami 🔑Q.5 Ans. :Apex Legends 🔑Q.6 Ans. :Riga 🔑Q.7 Ans. :Lead 🔑Q.8 Ans. :MR 🔑Q.9 Ans. :The Hurt Locker 🔑Q.10 Ans. :James Watt 🔗 Link :City Holder #cityholder ❤️ If you appreciate our work, tap a like or heart to support — we’ll keep bringing top passive income projects!

Hashtags

🏢 Daily Quiz :14 Jul 🔑Q.1 Ans. :Jeff Bezos 🔑Q.2 Ans. :Decentralization 🔑Q.3 Ans. :Wellington 🔑Q.4 Ans. :Forrest Gump 🔑Q.5 Ans. :Gobi 🔑Q.6 Ans. :Dow Jones 🔑Q.7 Ans. :Pokémon GO 🔑Q.8 Ans. :Gabriel García Márquez 🔑Q.9 Ans. :Jack Dorsey 🔑Q.10 Ans. :Guido van Rossum 🔗 Link :City Holder #cityholder ❤️ If you appreciate our work, tap a like or heart to support — we’ll keep bringing top passive income projects!

Hashtags

🏢 Daily Quiz :13 Jul 🔑Q.1 Ans. :Antoine de Saint-Exupéry 🔑Q.2 Ans. :The Scream 🔑Q.3 Ans. :Paradise Lost 🔑Q.4 Ans. :In Search of Lost Time 🔑Q.5 Ans. :Magical Realism 🔑Q.6 Ans. :Alexander Pushkin 🔑Q.7 Ans. :Data Mining 🔑Q.8 Ans. :Decentralization 🔑Q.9 Ans. :Psychologism 🔑Q.10 Ans. :Anton Chekhov 🔗 Link :City Holder #cityholder ❤️ If you appreciate our work, tap a like or heart to support — we’ll keep bringing top passive income projects!

Hashtags

🏢 Daily Quiz :12 Jul 🔑Q.1 Ans. :Evaporation 🔑Q.2 Ans. :Electron 🔑Q.3 Ans. :Atomic physics 🔑Q.4 Ans. :Electrolysis 🔑Q.5 Ans. :Blockchain 🔑Q.6 Ans. :Jupiter 🔑Q.7 Ans. :Ethology 🔑Q.8 Ans. :Troposphere 🔑Q.9 Ans. :Mitochondrion 🔑Q.10 Ans. :Dispersion 🔗 Link :City Holder #cityholder ❤️ If you appreciate our work, tap a like or heart to support — we’ll keep bringing top passive income projects!

Hashtags

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