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

Пребарај: #terny

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

@druschbaFm_en · Post #52058 · 14.03.2025 г., 08:04

⚡️🇷🇺🇺🇦⚡️ Two Majors #Summary for the Morning of 14 March 2025; 07:00 (GMT+3)⚡️ 🛡 The Enemy attacked an oil complex in #Tuapse using drones overnight. One of the fuel storage tanks caught fire, with the blaze covering an area of over 1,000 square metres. Emergency services are on-site. Additionally, drones were shot down over the #Saratov and #Voronezh regions. 🔹 In #Kursk Region, the 'Group of Troops North' liberated #Zaoleshenka and the settlement of #Goncharovka, clearing the outskirts of #Sudzha from all sides. The enemy continues to strike the liberated areas, trying to inflict maximum damage on our forces. Footage of destroyed enemy equipment is emerging, showing that the AFU suffered heavy losses while attempting to withdraw from the region.🎬👆Fighting continues in the Kuriklovka area. More evidence is surfacing from the liberated territories, documenting atrocities committed by nationalists against civilians. Battles are also ongoing near Basovka in the Sumy region. 🔹 In #Liman Section, north of #Terny, reports indicate fighting in the area of #Novolyubovka. 🔹 In #Seversk Sector, the enemy reported Russian activity near 'Sakkо and Vanzetti', a section of the front that has not been mentioned in recent reports. 🔹 In #Toretsk, battles with enemy units continue in different parts of the city. The enemy is still deploying groups into the urban area. 🔹 In #Pokrovsk Direction, fighting continues near #Uspenovka, #Udachnoye, #Kotlino, #Peschanoye, and #Shevchenko. Despite the high intensity of combat, the front line remains largely unchanged. 💥 In #Belgorod Region, in the Volokonovsky district, a private residence in the village of #Konovalovo was damaged by a drone attack. In the hamlet of #Gayevka, a drone strike damaged a piece of specialised machinery. In the Valuysky district, an FPV drone attacked a cargo vehicle in #Kaznacheyevka, while another drone struck a private house. In the village of #Grafovka, Krasnoyaruzhsky district, two drones detonated. In the settlement of #Oktyabrsky, Belgorod district, an FPV drone strike injured two men. Another drone detonated in the settlement of #Dalny, Valuysky district, injuring a woman. In #Shebekino, two FPV drones struck an industrial facility. In the Volokonovsky district, in the village of #Borisovka, a Nazi drone attacked a private residence. 💬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.