Подразумеваемые неймспейсы или неявные пакеты.
Этот функционал добавлен в 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
🇵🇰#Pakistan: At least seven people, including two policemen, were killed and more than 20 others injured in an explosion targeting a police vehicle in the Serai Naurang area of Lakki Marwat district, Khyber Pakhtunkhwa province.
According to local authorities, the blast occurred in a crowded market area during a routine police patrol, causing multiple civilian casualties and extensive damage to nearby shops and vehicles. The exact nature of the explosion remains under investigation. However, the attack follows a recurring pattern in the region of TTP (Tehrik-i-Taliban Pakistan) militants specifically targeting police and security force vehicles.
Meanwhile, roughly 30 km away, TTP militants blew up the Lora Fateh Khel bridge in Bannu district, effectively isolating multiple nearby areas. Just days earlier, another police checkpoint in the region was targeted in a suicide attack.
(via @TKCkhyber on X)
🇵🇰#Pakistan: Footage showing the Pakistani armed group Ittihad-ul-Mujahideen ambushing an armoured police vehicle in the Bannu District. After firing several magazines and rpg rounds in the armoured vehicle, the police officer inside is still alive.
The militants, after attempting to smash the window of the vehicle, force the person inside to open the door, shooting him point blank with a pistol.
(via @war_noir)
🇵🇰#Pakistan: A Tehrik-i-Taliban Pakistan (TTP) sniper records the moment when a police checkpoint gets blown up by militants in the Kamal Sar market area of Bajaur.
The second part of the video also shows the aftermath of the explosion.
🇵🇰#Pakistan: Footage released today by Baloch Liberation Army's media showing their militants attacking a Pakistani Army camp in the Kech region. The attack was recorded on March 29th of this year.
The militants used RPG rocket launchers and small arms fire to suppress and destroy the military outpost.
🇵🇰#Pakistan: Footage showing a militant from Tehrik-i-Taliban Pakistan ambushing a Pakistani Army convoy in Khyber Pakhtunkhwa using an SVD.
(via @war_noir)
🇵🇰#Pakistan: The Balochistan Liberation Army has released footage of its attack on a Pakistani military boat in the waters of Jiwani, Gwadar, where three soldiers were killed.
🇵🇰#Pakistan: Balochistan Liberation Army (BLA) militants have ambushed a Pakistani Coast Guard (PCG) patrol boat off the coast of Jiwani, Gwadar, killing three troops who were on board.
This would mark the first time that Pakistani forces have been targeted at sea within Balochistan. No footage of the attack has emerged yet, but BLA media outlets have published a statement claiming responsibility.
The attack was also confirmed by the Pakistani side.
🇵🇰#Pakistan: Footage released by BLA (Balochistan Liberation Front) showing it's militants ambushing Pakistani soldiers in Quetta, Balochistan.
(via @war_noir)
🇵🇰#Pakistan: A police vehicle was blown up by an IED (improvised explosive device) in Lakki Marwat, in the Khyber Pakhtunkhwa province of Pakistan.
The explosion injured four police officers who were inside the vehicle at the time. No group has claimed responsibility for the attack so far, although the area has been an active region for attacks by TTP (Tehreek-e-Taliban Pakistan) militants.
(📸 via @pakafghanmatter on X)
🇵🇰Pakistan arrests activists at Women's Day march
More than 30 people, including women, men and children, were detained during an International Women's Day march in Islamabad on March 8. Among those held was sociologist Mavra Bari, who described being kept in a cramped cell and said detainees were beaten. An AFP journalist observed those released bearing signs of physical ill-treatment.
Amnesty International and Human Rights Watch have documented a pattern of arbitrary detention, enforced disappearances and legal harassment of activists, lawyers and journalists in Pakistan. Human rights lawyer Imaan Mazari and her husband are serving lengthy jail terms for social media posts deemed anti-state, while digital journalist Sohrab Barkat has been held without trial since late 2025.
The Committee to Protect Journalists reported at least seven journalists killed in Pakistan in 2024, with others facing harassment. The Human Rights Commission of Pakistan's secretary general described new media laws as draconian, while press freedom group Reporters Without Borders has pointed to increasing state pressure on independent outlets.
#Pakistan
@asianomics
🇵🇰#Pakistan: The Balochistan Liberation Army (BLA) has launched a coordinated attack on a Pakistani Coast Guard post, killing three troops stationed there. From the footage, it seems that the soldiers were not armed during the attack.
The militants were allegedly "disguised" (possibly dressed as civilians or friendly troops). They passed through a Pakistani checkpoint on motorbikes before opening fire.
The footage was dated as March 15th and was posted on BLA telegram channels.