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

Резултати

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

Пребарај: #nesteryanka

当前筛选 #nesteryanka清除筛选
DruschbaFM - English

@druschbaFm_en · Post #52226 · 18.03.2025 г., 08:03

⚡️ 🇷🇺 🇺🇦⚔️ Ukraine Fronts on the Morning of 18 March⚡️ 🔴#Sumy Direction: 🔴In #Sudzha Sector, west of the city on Ukrainian territory, battles are being fought for the villages of #Zhuravka and to the southeast for #Basovka. 🟡 In #Kursk region, heavy battles are taking place for the villages of #Gogolevka, most of which is under Russian control, and #Guyevo. 🟡#Oleshnya and #Gornalin the far south are the last villages in the #Kursk region still under AFU control. 🗺 Map 1 🔴#Kharkov Direction: 🔴In #Liptsy Section, there are positional battles, as well as... 🔴 In #Volchansk Section, especially in and in the area of the city. 🔴#Svatovo Front: 🔴 In #Kupyansk Sector, north of the city, the expansion of the Russian bridgeheads on the right bank of the Oskol River continues. 🟡 In the area of #Petropavlovka, Russian troops have advanced almost 1 km towards #Kupyansk. 🔴 In #Borovaya Sector, the battle for #Boguslavka continues with fierce fighting in its northern outskirts. 🔴In #Liman Sector, Russian troops attack in the areas of ​​#Yampolovka and #Novolyubovka. 🔴In #Seversk Sector, the RFAF attack in the area of #Verkhnekamenskoye. Otherwise positional battles. 🔴#ChasovYar Direction: 🔴In #ChasovYar Sector, Russian troops continue attacks in the settlements area of #OrekhovoVasilyevka and #Grigorovka. 🟡 In the City, Russian forces are advancing in several microdistricts. 🟡 Towards #Stupochki, south of the city, the Russians are attacking as well. 🔴In #Toretsk Sector, fights for #Krymskoye, in the city itself and even in the southern 'Zabalka Microdistrict' continue. 🗺 Map 2 🔴#Pokrovsk Direction: 🔴 On the right Flank, far east the front has been reactivated. The RFAF advanced from #Novobakhmutovka in the direction of #Aleksandropol. 🟡 Towards #Aleksandropol2nd and #Tarasovka, Russian assault groups are attacking. 🗺 All on Map 2 🔴 South of the City, battles for #Lysovka, #Shevchenko, #Peschanoye, and #Kotlino continue. 🔴 On the left Flank, battles for #Udachnoye continue. 🟡 In #Uspenovka, the RFAF could regain 50% control. 🟡 Southwest of #Nadezhdinka (#Nadeyevka), Russian units are attacking towards #Kotlyarovka. 🟡#Preobrazhenka has been entered by Russian forces. There are fights in the eastern settlement part. 🔴#Komar Direction: 🔴In #Kontantinopol Sector, Russian assault groups are attacking from the area of #Andreyevka towards #Alekseyevka. 🔴 In #Komar Sector, the RFAF advanced south of the #Vesyoloye village along the forest belt. Further southwest, the RFAF expanded the control zone on the #Privolnoye - #Novosyolka line up to 2 km, taking up new positions south of #Privolnoye. 🔴#Zaporozhye Direction: 🔴In the #Orekhov Section, the RFAF continue the offensive north of #Nesteryanka and southeast of #Shcherbaki on a broad front towards #Novoandreyevka, in the vicinity of which the town of #Orekhov itself is located to the northeast. 🟡#Shcherbaki, #MalyeShcherbaki and #Stepovoye came under Russian control. Clearing is taking place. This according to unconfirmed reports. Further evidence or confirmation from the opposing side are currently missing. 🟡 Nort of #Pyatikhatki, there is fighting on the approaches to #Lobkovoye. 🗺 Map 3 💥 In #Kherson Direction, mutual strikes. The RFAF targets EW systems, vehicles, and firing positions while the AFU concentrate on civilian objects. 💥#OldRussia: 🔵 In #Belgorod Region, the AFU attacked civilian targets in several villages overnight, causing civilian casualties. 🎯 The RFAF struck targets in #Dnepropetrovsk, #Kiev, #Odessa, #Cherkassy, #Poltava, and #Nikolayev regions. 🗺 Maps @olegtsarov; @voenkorKotenok 📋 Sources: CC; Tsarov; ⚡️2M; 🇺🇦Fiend; 😼Kotenok 🕰18 Mar 2025; 06:40 GMT+3; #smo 📱 Join GLOBAL DEPTH to boost your TG Feed 💬Welcome to Military Chat & Ukraine Observer 🇺🇦On Ukraine Observer you will find your daily independent Ukraine War Battle Update