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

Резултати

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

Пребарај: #defence

当前筛选 #defence清除筛选
Indian Development News 🇮🇳

@developmentnewsindia · Post #44446 · 05.05.2026 г., 11:00

BEL secured a ₹1,476 crore Ministry of Defence contract for the Indian Army to supply the Ground Based Mobile Electronic Intelligence System (GBMES). This fully indigenous system, designed by Defence Electronics Research Laboratory (DLRL), Hyderabad, and manufactured by BEL, detects, classifies, and locates radar signals, while intercepting and analysing communication signals. #Defence

Hashtags

Indian Development News 🇮🇳

@developmentnewsindia · Post #44351 · 03.05.2026 г., 05:17

India to manufacture ~140 AMCA stealth jets at Puttaparthi; Andhra allots 600 acres to Defence Research and Development Organisation. Project size ~₹1 lakh crore; final assembly/testing hub near Aeronautical Development Agency Bengaluru base. #Defence

Hashtags

Indian Development News 🇮🇳

@developmentnewsindia · Post #44278 · 01.05.2026 г., 08:09

BREAKING LR-AShM enters Phase-II trial: India successfully test fires Long Range Anti-Ship hypersonic Missile from a #defence facility off Odisha coast. Indigenously developed by DRDO, the two-stage hypersonic glide weapon can strike moving and static naval vessels at distances up to 1,500 km and boasts high-accuracy terminal manoeuvres. Travelling at a speed of over Mach 5, it can also target warships or land surfaces. The missile will have multiple warhead configurations.

Hashtags

Indian Development News 🇮🇳

@developmentnewsindia · Post #44267 · 01.05.2026 г., 02:34

Paras Defence & Space Technologies has won a significant Rs 7.72 crore contract from DRDO for developing advanced Ku/C-Band Satellite Communication Phased Array Antennas designed for airborne defence applications. The project has a comprehensive timeline extending until April 29, 2028, reflecting the sophisticated nature of the satellite communication technology development required for modern defence operations. Source #Defence

Hashtags

Indian Development News 🇮🇳

@developmentnewsindia · Post #44225 · 30.04.2026 г., 09:27

Report- Speaking at the ANI National Security Summit 2.0 in New Delhi, #Defence Secretary Shri Rajesh Kumar Singh said the procurement process for the AMCA is underway and a Request for Proposal (RFP) is expected to be issued soon to shortlisted private sector players. He also indicated that India is also exploring collaboration on sixth-generation fighter aircraft, given the massive investment such programmes require. “We’ve made it clear… that we are interested and we could consider partnering them for a sixth generation fighter program. Let’s see what the response is,” he said.

Hashtags

Indian Development News 🇮🇳

@developmentnewsindia · Post #44194 · 29.04.2026 г., 14:08

Just in: The DRDO and the Indian Navy jointly and successfully conducted the first 'salvo launch' of the 'Naval Anti-Ship Missile-Short Range' (NASM-SR) from an Indian Navy helicopter platform off the coast of the Bay of Bengal in Odisha. #Defence

Hashtags

123•••56
ПретходнаСтраница 1 од 6Следна