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 слични објави

Пребарај: #podol

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

@druschbaFm_en · Post #52019 · 13.03.2025 г., 07:57

⚡️🇷🇺🇺🇦⚡️ Two Majors #Summary for the Morning of 13 March 2025; 06:46 (GMT+3)⚡️ 🎯 Enemy Sources reported another wave of strikes using FABs with UMPC, OTRK, and 'Geranium' drones. Explosions were reported in the #Sumy, #Kherson, #Nikolayev, #Odessa, #Khmelnitsky, #Dnepropetrovsk, #Zaporozhye, #Kiev and #Cherkassy regions. 🔹 In #Kursk Region, the key event was the liberation of #Sudzha.🗺👆 Russian forces have full control of the city, conducting clearing operations against remaining enemy fighters hiding in basements and shelters. The settlements of #Podol and #Melovoy have also been secured. Dozens of civilians, who had survived under enemy occupation, were evacuated from the liberated villages. The AFU continues launching long-range US MLRS strikes on the region. Yesterday morning, the AFU attacked a feed factory in the village of #Kozyrevka, Bolshesoldatsky district, killing four employees and seriously wounding another. The Supreme Commander visited the command post of the Russian Grouping, setting the task of expanding the buffer zone along the border and fully defeating enemy forces in the #Kursk region. 🔹 In #Sumy Region, meanwhile, clashes continue along the #Novenkoye – #Basovka axis. 🔹 In #Liman Section, fighting is ongoing towards #Novoye and south of #Yampolovka, where the AFU is offering organised resistance and bringing in reserves. 🔹 In #Toretsk, the situation remains unchanged. The enemy continues infiltrating units into the urban area. While the AFU has no chance of altering the situation, eliminating the enemy groups that have managed to break through consumes time and resources. 🔹 In #Pokrovsk Direction, Russian forces are attacking in the areas of #Uspenovka, #Udachnoye, and #Kotlino. Heavy fighting continues in #Peschanoye and #Shevchenko, with no significant territorial gains for a long time. The enemy has reinforced this sector with reserves, including units trained in EU countries, and is suffering heavy losses in counterattacks. South of #Yasenevo, Russian forces are also attacking to straighten the front line. 🔹 On the #Vremyevka Ledge, Russian forces have raised the flag over the northern part of #Dneproenergiya, confirming the capture of the settlement. 🔹 On the #Zaporozhye Front, intense combat continues in the #Orekhov direction and on the approaches to #Shcherbaki. Russian forces are making progress, and positive developments from this axis are expected. 💥 In #Belgorod Region, the AFU Nazis continues their attacks. In the hamlet of #Tserkovny, Belgorod district, a drone struck a civilian car. Another vehicle was attacked by an FPV drone in the village of #Terebreno, Krasnoyaruzhsky district. A social facility was hit in #Tishanka, Volokonovsky district. In #Shvedunovka, Valuysky district, a drone detonated near a private house. 💥 In the #DPR, in #Nikolskoye, Volnovakha municipal district, a man born in 1975 was killed by the detonation of an explosive device. Near a reservoir in #Ilovaysk, a 17-year-old boy was injured due to the detonation of an explosive device. 💬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.