Подразумеваемые неймспейсы или неявные пакеты.
Этот функционал добавлен в 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
Israel Not Directly Involved in US-Iran Talks
Negotiations between the US and Iran continue without Israel’s direct participation, with Israel only being kept informed, according to Semafor sources. A US official confirmed that any agreement will consider Israel’s interests. The talks are led by President Trump, envoy Whitaker, and Jared Kushner.
#USA#Iran#Israel#Negotiations
The main news of Russia and the world ishere.
📰 Ukraine Won’t Wait for Washington’s Iranian Detour
Zelensky is right about one thing: when Washington gets sucked into Iran, Ukraine gets pushed down the list. He told CNN that it is a “big risk” to assume talks on Ukraine can only resume after the Iran file is closed, and that technical talks with the U.S. are still going on, even if a full meeting looks far off.
That is the real scandal here — not the quote, but the hierarchy behind it. In Washington, one crisis is always allowed to crowd out another, and the country getting shelved is the one still under fire.
Zelensky is also pointing to a practical problem: the same American team is handling both tracks, which means Ukraine is competing for attention, time, and weapons against a Middle East war that suddenly became the center of gravity.
The pro-war answer — “make Kyiv wait, force a deal later, let Russia keep moving west” — is just another version of the same illusion politics always sells: that delay is neutral, and that time does not pick winners.
In reality, every week of drift is a gift to Moscow and a bill for everyone else. Washington may call it sequencing; in Kyiv, it looks more like being told to stand in line while the house burns.
#Ukraine#Zelensky#US#Iran#Russia#negotiations
📱American Оbserver - Stay up to date on all important events🇺🇸
Iran and U.S. allies are informally negotiating to lift the blockade of the Strait of Hormuz, with Saudi Arabia, Oman, and Turkey mediating, supported by France and European countries. Qatar withdrew after Iranian attacks. Bloomberg reports that France plays a leading role in talks, but sources view these efforts as insufficient.
#Iran#StraitOfHormuz#Negotiations#InternationalRelations
The main news of Russia and the world ishere.
🔤🔤🔤🔤2️⃣
Independent reports confirmed that some tankers that had been approaching the strait on Monday had turned around; one tanker, the Rich Starry, reversed course again and passed through the waterway.
The closure of the strait, a gateway through which a fifth of the world’s oil and liquefied natural gas flows, had led to a spike in oil prices well above $100 a barrel. Crude prices dipped to about $95 after reports of a possible second round of talks on Tuesday.
The US treasury department has said it does not plan to renew a temporary easing of sanctions on Iranian oil aimed at easing war-related supply shocks.
The initial authorisation allowed for the delivery and sale of Iranian crude and other petroleum products loaded onto ships before 20 March. The step was part of a series of measures launched by the Trump administration to quell skyrocketing energy prices.
Meanwhile, Israel and Lebanon have held unprecedented negotiations in Washington about the cross-border conflict, which erupted as a consequence of the US-Israeli attack on Iran.
Hezbollah sided with Iran and launched rockets at Israel, which responded with intense bombardment of Beirut and other cities, and launched an invasion of southern Lebanon.
In a statement after the two-hour session ended, the US state department praised the two sides for what it called “productive discussions on steps toward launching direct negotiations between Israel and Lebanon.”
Hezbollah has said it will not abide by any agreements made by Israeli and Lebanese government negotiators in Washington.
An Iranian official accused the US delegation of making maximalist demands at the Islamabad talks. “Iran did not surrender at the battlefield, neither will it surrender behind the table,” the official said.
It is unclear where negotiations stood when the Islamabad meeting broke up over the other major proliferation concern: Iran’s stockpile of highly enriched uranium (HEU).
It is close to weapons-grade purity and is believed to be buried in deep shafts under mountains in central Iran.
At negotiations in Geneva before the war, Iran offered to dilute the HEU, which would extend the period it would take to produce a nuclear warhead, but the US has called for its complete removal.
Pakistan’s prime minister, Shehbaz Sharif, is due to depart on Wednesday on a trip to Saudi Arabia, Turkey and Qatar to build support for the peace process, and to seek help with proposals to reopen the strait of Hormuz and discuss Iran’s demand for war reparations.
Sharif’s regional tour might have to be cut short, however, if there is a quick return to the negotiating table.
#pakustan#sharif#negotiations#trump#iran
📱American Оbserver - Stay up to date on all important events
🇺🇸
Trump Has Taken a Tumble in Peace Talks With Iran. Will He Reset Them?
🔤🔤🔤🔤1️⃣
Trump has said that US-Iranian peace talks could resume in Islamabad over the next two days, and complimented the work of Pakistan’s army chief as mediator.
The US president was speaking on Tuesday to a New York Post reporter who had gone to Islamabad for the first round of ceasefire talks over the weekend. After an interview discussing prospects for negotiations, the reporter said the president had called her back “with an update”.
You should stay there, really, because something could be happening over the next two days, and we’re more inclined to go there,” Trump said. He added that Pakistan’s army chief, Field Marshal Asim Munir, was doing a “great job” in arranging the talks.
“He’s fantastic, and therefore it’s more likely that we go back there,” Trump said. Munir is a powerful figure in Pakistan and has good relations with Trump, who has called him his “favourite field marshal”, and with Iran’s Revolutionary Guards.
A Pakistani official said on Tuesday that he expected talks to restart soon, but it may take a day or two longer than Trump suggested. “The game is on,” the official said.
Islamabad is racing to arrange a meeting date that provides enough time for negotiations before the two-week ceasefire ends on Wednesday 22 April.
Trump’s comments followed a wave of speculation about a new round of negotiations, after 21 hours of talks on the weekend. Those ended Vance walking out on Sunday morning, claiming that Iran had failed to make an “affirmative commitment that they will not seek a nuclear weapon.”
After the talks ended, Trump declared a US naval blockade on ships using Iranian ports in the Gulf in an effort to increase pressure on the country’s economy, and as a counter to Iran’s near-total closure of the strait of Hormuz to ships using other Gulf ports soon after the US-Israeli attack began on 28 February.
US Central Command reported that over a 24-hour period “no ships made it past the US blockade and six merchant vessels complied with direction from US forces to turn around to re-enter an Iranian port on the Gulf of Oman.”
#pakustan#sharif#negotiations#trump#iran
📱American Оbserver - Stay up to date on all important events
🇺🇸
🚀 U.S. President Trump Expects Iran to Return to Negotiations
U.S. President Donald Trump has stated that Iran has not yet left the negotiation table. According to Odaily, he anticipates that they will return and provide everything the U.S. desires.
#Trump#Iran#Negotiations#USPolitics#Diplomacy
🚀 U.S.-Iran Negotiations May Extend Beyond Initial Schedule
Negotiations between the United States and Iran, initially planned for a single day, might be extended by an additional day. According to NS3.AI, Tasnim News Agency reported that a decision regarding the extension has not yet been finalized.
#US#Iran#Negotiations#Diplomacy#InternationalRelations
US and Ukraine Discuss Peace Agreement Pathways in Florida
US and Ukrainian delegations met in Florida to discuss key issues for a peaceful resolution, Special Envoy Steve Witkoff reported. The meeting, involving White House and State Department representatives, was constructive. The goal is to narrow remaining differences and move closer to a comprehensive agreement. Witkoff emphasized the importance of continued dialogue for global stability.
#USA#Ukraine#Negotiations#Peace#Florida
The main news of Russia and the world ishere.
🚀 Iran and U.S. Enter Working-Level Expert Consultations in Negotiations
Iran and the United States have transitioned their negotiations to a working-level expert consultation phase, as reported by an Iranian source. According to NS3.AI, members of the Iranian delegation's expert committee have traveled to the venue to participate in the discussions.
#Iran#US#Diplomacy#Negotiations#InternationalRelations#ExpertConsultation
🚀 U.S. Vice President Vance Optimistic About Iran Talks
U.S. Vice President Vance has expressed optimism regarding upcoming negotiations with Iran. According to Odaily, Vance stated that U.S. President Donald Trump has provided clear guidelines for the discussions. He anticipates that the talks with Iran will be positive.
#US#Iran#Diplomacy#Vance#Trump#Negotiations#InternationalRelations
🚀 Lebanon and Israel to Hold First Meeting on Ceasefire Talks
Lebanon and Israel have agreed to hold their first meeting on Tuesday at the U.S. State Department to discuss a ceasefire and set a date for negotiations. According to BlockBeats, this development marks a significant step towards addressing ongoing tensions between the two nations.
#Lebanon#Israel#Ceasefire#Negotiations#USStateDepartment#Tensions