TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #401 · 15 дек.

Функция asyncio.wait() это еще один способ вызвать множество асинхронных задач. Она работает в нескольких режимах. 1. Самый простой - ждем завершения всех задач async def main(): tasks = [asyncio.create_task(do_it(i)) for i in range(10)] done, pending = await asyncio.wait( tasks, return_when=asyncio.ALL_COMPLETED ) for task in done: try: print(task.result()) except Exception as e: print(e) Очень похоже на gather, но работает не так. ▫️возвращает не результаты, а два сета с объектами Task у которых можно забрать результат через task.result() если они в списке done ▫️не гарантирует порядок результатов так как оба объекта это set ▫️не выбрасывает исключение когда оно появляется, а сохраняет его в Task. Исключение появится когда попробуете забрать резултьтат. 2. Ждем завершения первой задачи, даже если там ошибка. async def main(): tasks = [asyncio.create_task(do_it(i)) for i in range(3)] done, pending = await asyncio.wait( tasks, return_when=asyncio.FIRST_COMPLETED ) # в done может быть несколько задач! for task in done: try: print(task.result()) except Exception as e: print(f"Fail: {e}") # Оставшиеся задачи в pending, как правило, нужно отменить, иначе они будут продолжать работать for task in pending: task.cancel() В сете done будут таски которые успели завершится, причем как успешно так и нет. 3. До первой ошибки. Тоже самое, но с аргументом FIRST_EXCEPTION done, pending = await asyncio.wait( tasks, return_when=asyncio.FIRST_EXCEPTION ) Функция завершается как только первая задача упадет с ошибкой. Учтите, что в любом случае done вы можете обранужить несколько задач, как с ошибками так и успешные. ↗️ Полный листинг примеров здесь #async

Hashtags

Резултати

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

Пребарај: #decrease

当前筛选 #decrease清除筛选

⬛️Iqtisodiy faktlar... 🇺🇸AQShdagi Buyuk retsessiya: sabablari, oqibatlari va saboqlari 💵Ushbu iqtisodiy beqarorlik davri 1930-yillardagiBuyuk Depressiyadan keyingi eng jiddiy inqiroz deb hisoblanadi. “Buyuk retsessiya” atamasi 2007-yil dekabridan 2009-yil iyunigacha davom etgan AQSh tanazzuliga ham, 2009-yilda sodir bo‘lgan jahon iqtisodiytanazzulga ham aloqador. 🔎Batafsil 🚩 Великая рецессия в США: причины, последствия и уроки 📊Этот период экономической нестабильности считается самым серьёзным кризисом со времён Великой депрессии 1930-х годов. Термин «Великая рецессия» относится как к рецессии в США, продолжавшейся с декабря 2007 по июнь 2009 года, так и к глобальному экономическому спаду, который последовал в 2009 году. 🔎Подробнее #GraduateSchool#Recession#Decrease#Economy 🔝Web-site |🔝Facebook | 🔝Instagram | 🔝Youtube

📕Iqtisodiy atamalar... 📈 Ushbu davrda kompaniyalar xarajatlarni qisqartirishi, iste’molchilar talabi pasayishi, ishsizlik ortib borishi kuzatiladi, bu esa mamlakatning umumiy iqtisodiy iqlimiga salbiy ta’sir ko‘rsatadi. 🏭 Retsessiya iste’mol xarajatlarining pasayishi, kreditshartlarining yomonlashishi, tashqiiqtisodiy zarbalar yoki investitsiyalarning keskin kamayishi kabi turli omillar tufayli yuzaga kelishi mumkin. 📊 During this time, companies reduce spending, consumer demandfalls, and unemploymentrises, negativelyaffecting the country’s overall economic climate. ⬇️ A recession can be triggered by various factors, such as lower consumer spending, worsening creditconditions, externaleconomic shocks, or a sharp drop in investment. #GraduateSchool#Recession#Decrease#Economy 🔝Web-site |🔝Facebook | 🔝Instagram | 🔝Youtube

Journey to Fluency

@fluencyinenglish · Post #7852 · 05.04.2022 г., 08:31

#common_mistakes #decrease #in#of @fluencyinenglish معمولاً از عبارت زیر برای کاهش در چیزی صحبت می کنیم. ✔️ decrease in sth با این حال،معمولاً از عبارت زیر برای کاهش مقدار بکار می بریم. ✔️ decrease of sth مثال: • There has been a 2% decrease in the rate of unemployment. 2 درصد کاهش در نرخ بیکاری وجود داشته است. • There has been a decrease of 2%. 2 درصد کاهش وجود داشته است. • There was a slight decrease in his weight after a week of dieting. بعد از یک هفته رژیم، یک کاهش کوچک در وزنش وجود داشت. • Any decrease in tourism could have a serious effect on the local economy. هر گونه کاهشی در گردشگری می‌توانست اثری جدی بر اقتصاد محلی بگذارد. • The report's finding on the decrease in violent crime supports the police chief's claims. • We have seen a marked decrease in the number of accidents since these safety measures were introduced. از وقتی این تدابیر امنیتی ارائه شدند، کاهش شدیدی در تعداد تصادفات مشاهده شده است. • We've noticed a steady decrease in jobs available for new graduates in the industry. @fluencyinenglish

Journey to Fluency

@fluencyinenglish · Post #7837 · 18.07.2021 г., 06:26

#common_mistakes #decrease #in#of @fluencyinenglish معمولاً از عبارت زیر برای کاهش در چیزی صحبت می کنیم. ✔️ decrease in sth با این حال،معمولاً از عبارت زیر برای کاهش مقدار بکار می بریم. ✔️ decrease of sth مثال: • There has been a 2% decrease in the rate of unemployment. 2 درصد کاهش در نرخ بیکاری وجود داشته است. • There has been a decrease of 2%. 2 درصد کاهش وجود داشته است. • There was a slight decrease in his weight after a week of dieting. بعد از یک هفته رژیم، یک کاهش کوچک در وزنش وجود داشت. • Any decrease in tourism could have a serious effect on the local economy. هر گونه کاهشی در گردشگری می‌توانست اثری جدی بر اقتصاد محلی بگذارد. • The report's finding on the decrease in violent crime supports the police chief's claims. • We have seen a marked decrease in the number of accidents since these safety measures were introduced. از وقتی این تدابیر امنیتی ارائه شدند، کاهش شدیدی در تعداد تصادفات مشاهده شده است. • We've noticed a steady decrease in jobs available for new graduates in the industry. @fluencyinenglish

Crypto M - Crypto News

@CryptoM · Post #65206 · 12.04.2026 г., 01:42

🚀 Bitcoin(BTC) Drops Below 72,000 USDT with a 1.23% Decrease in 24 Hours On Apr 12, 2026, 01:42 AM(UTC). According to Binance Market Data, Bitcoin has dropped below 72,000 USDT and is now trading at 71,964.390625 USDT, with a narrowed 1.23% decrease in 24 hours. #Bitcoin#BTC#USDT#Binance#cryptocurrency#marketdata#price drop #decrease

Crypto M - Crypto News

@CryptoM · Post #64548 · 09.04.2026 г., 07:21

🚀 Bitcoin(BTC) Drops Below 71,000 USDT with a 1.14% Decrease in 24 Hours On Apr 09, 2026, 07:21 AM(UTC). According to Binance Market Data, Bitcoin has dropped below 71,000 USDT and is now trading at 70,975.132813 USDT, with a narrowed 1.14% decrease in 24 hours. #Bitcoin#BTC#cryptocurrency#USDT#Binance#marketdata#priceupdate#decrease#24hours

Crypto M - Crypto News

@CryptoM · Post #65266 · 12.04.2026 г., 13:01

🚀 Bitcoin(BTC) Drops Below 71,000 USDT with a 2.59% Decrease in 24 Hours On Apr 12, 2026, 13:01 PM(UTC). According to Binance Market Data, Bitcoin has dropped below 71,000 USDT and is now trading at 70,972.90625 USDT, with a narrowed 2.59% decrease in 24 hours. #Bitcoin#BTC#USDT#cryptocurrency#marketupdate#Binance#pricechange#decrease#24hour