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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #197 · 4 јан.

Подразумеваемые неймспейсы или неявные пакеты. Этот функционал добавлен в Python 3.3 Что он означает? Ранее, до 3.3 пакетами считались лишь директории, в которых есть файл __init__.py. Этот файл одновременно являлся свидетельством того, что директория это Python-пакет, и служил "телом" этого пакета. То есть местом, где можно написать код, как это делается внутри модуля. Этот код исполняется в момент импорта пакета, так что его принято называть "код инициализации пакета". Начиная с версии 3.3 Любая директория считается пакетом и Python будет пытаться использовать любую директорию для импорта. Конечно, не любую в файловой системе, а только те что находятся в sys.path. Это значит, что теперь __init__.py нужно делать только если: 🔸 вам требуется создать код инициализации пакета 🔸 нужна совместимость со старыми версиями Python На мой взгляд это немного упрощает разработку, делает её чище, но с другой стороны убивает некоторую однозначность происходящего. Например, я создал репозиторий со своей библиотекой и рядом положил код примеров или тестов. repo_name/ my_library/ __init__.py main.py examples/ exam1.py exam2.py В этом репозитории пакетом является только my_library, остальные директории это не пакеты, это просто дополнительный код в файлах. Директория examples не добавлена в sys.path, в ней нет рабочих модулей. Но если она лежит рядом с my_library, то Python вполне сможет импортнуть из неё модули, так как посчитает что examples это валидный пакет. Конечно, пример несколько надуманный. Никто не будет добавлять корень репозитория в sys.path. Но, я думаю, суть ясна. Иногда директория это просто директория а не пакет! #basic#pep

Hashtags

Резултати

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

Пребарај: #dobroye

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

@druschbaFm_en · Post #51966 · 12.03.2025 г., 08:02

⚡️🇷🇺🇺🇦⚡️ Two Majors #Summary for the Morning of 12 March 2025; 06:27 (GMT+3)⚡️ 🔹 The Russian Army continues its #Kursk offensive with decisive objectives. Yesterday, #KazachyaLoknya, #Zamostye, #Makhnovka, #Mirny, #Bondarevka, #Dmitryukov, and #Knyazhy1st and #Knyazhy2nd hamlets were liberated. Russian forces are advancing from #Sudzha’s industrial zone and central market, with reports of movement in the built-up areas. Footage has emerged of Ukrainian infantry retreating westward. Russian troops are also active in the #Sumy region near #Zhuravka. The #Sudzha – #Yunakovka Motorway is under Russian fire control, and AFU reinforcements attempting to enter the #Kursk region have been repelled. Heavy battles for the region’s liberation continue. 🎯 Russian Forces struck targets in #Odessa region overnight, with the enemy claiming a 'cargo ship carrying grain' was damaged. Confirmed strikes hit infrastructure in #Dnepropetrovsk, with explosions reported in #Kiev, #Pavlograd, #Kramatorsk, #SnakeIsland, as well as in the #Cherkassy, #Kharkov, #Sumy, and #Khmelnitsky regions. 🛡 Russian Air Defences repelled a night-time attack on the #Bryansk region. 🔹 In #Seversk Sector, Russian forces continue difficult advances west of #Belogorovka, facing fierce and organised 👉resistance. 🔹 In #Toretsk, reports persist of AFU units being deployed deeper into urban areas. 🔹 In #Pokrovsk Direction, clashes continue in #Shevchenko, #Peschanoye, #Kotlino, and #Uspenovka. On the far right flank, east of #Pokrovsk, Russian forces are attacking near #Tarasovka. 🔹 On the #Vremyevka Ledge, north of #VelikayaNovosyolka, the 'East Group of Troops' has secured #Dneprenergiya. The enemy claims successful counterattacks in #Novosyolka. 🔹 On the #Zaporozhye Front, Russian forces raised the flag over #Pyatikhatki after prolonged heavy battles.🎬👆The village, situated in a low-lying area, has been in ruins since summer 2023 and lacks underground shelters, making long term consolidation uncertain. 💥 In #Belgorod Region, the AFU continues to target civilians. In Shebekino district, a UAV attack damaged equipment at a commercial facility in #Dobroye. In #Shamino, an FPV drone struck a civilian car. Another drone hit a private residence in #NizhneyeBeryozovo2nd. In Grayvoron district, a UAV detonation in a private residence in #Glotovo caused an attic fire. In #Valuyki, an FPV drone damaged a car and shattered windows. In #Shelayevo, a drone exploded on the ground. 💥 In the #DPR, a 2001-born woman was injured in #Gorlovka following a Nazi artillery strike, with further damage to civilian infrastructure. In #KrasnayaPolyana, Volnovakha district, a 1966-born man sustained injuries from an explosive device detonation. 💬Welcome to Military Chat; 🇬🇧Battle Maps 📱 Join GLOBAL DEPTH to boost your TG Feed GLOBAL DEPTH from #HK This channel aims to unite interested individuals from around the world in an attempt to connect the dots. Subscriber participation is always welcome here and in the channel's Chat Group.