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

Резултати

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

Пребарај: #amman

当前筛选 #amman清除筛选
Papa & Vaticano - News

@papaevaticanonews · Post #9541 · 04.03.2026 г., 15:08

Sono rientrati oggi a #Roma, con un volo diretto da #Amman, i pellegrini italo-americani dell’Opera Romana Pellegrinaggi (Orp) rimasti bloccati a #Gerusalemme a causa degli eventi in corso in Medio Oriente. Il gruppo, accompagnato da don Giovanni Biallo, si trovava in Terra Santa da sabato 28 febbraio. L’Orp ha garantito tutta l’assistenza necessaria per la sicurezza in loco fino alla riprotezione sui primi voli disponibili, assorbendo totalmente i costi del prolungamento del soggiorno e del rimpatrio da Amman, in costante raccordo con le autorità consolari. “Esprimiamo tutta la nostra vicinanza e il costante ricordo nella preghiera alle comunità cristiane locali, raggiunte ancora una volta da una situazione di estrema difficoltà ed incertezza - dichiara suor Rebecca Nazzaro, direttrice dell’Orp -. Si auspica che quanto prima le parti coinvolte ascoltino il grido di pace che si eleva da un’umanità incredula e attonita per quello che sta succedendo, ma che non smette di sperare in un futuro di pace e concordia tra i popoli”. L’Orp segue costantemente l’evolversi della situazione e, per la programmazione dei pellegrinaggi in Medio Oriente, si attiene alle indicazioni delle autorità locali sulla sicurezza e all’operatività delle compagnie aeree.

Addis Standard

@addisstandardeng · Post #21566 · 28.02.2026 г., 18:48

Updates: #Ethiopian Airlines cancels regional flights to and from the #Middle_East as conflict escalates following #U.S.-#Israel strikes on Iran • Ethiopian Airlines has announced the cancellation of several flights to and from the Middle East due to the current security situation in the region. • In a statement, the airline said flights to #Amman, #Tel_Aviv, Dammam, and #Beirut have been cancelled. “We continue to actively monitor developments and will take appropriate measures to ensure the safety and convenience of our passengers and crew,” the airline said. • The announcement comes as multiple countries across the Middle East closed or restricted their airspace on Saturday, and major global airlines suspended services after a new wave of conflict erupted following a U.S.-Israeli military operation against Iran. • The United Nations Security Council is set to hold an ..... https://web.facebook.com/AddisstandardEng/posts/pfbid02A3Aigcru3jRVvCNMSc8ooHgbmjNvQ5zY2fYaDd9L8X1qJSXyKFU4wULzZ1vTyw7Kl

Addis Standard

@addisstandardeng · Post #21578 · 02.03.2026 г., 08:45

#Update: #Ethiopian Airlines extends flight suspensions to several #Middle_East destinations as regional airspace closures persist Ethiopian Airlines has announced updated suspension of flights to and from multiple Middle East destinations due to ongoing airspace closures across the region, the airline said in a statement. The cancellations affect services to #Amman (Jordan), #Beirut (Lebanon), #Tel_Aviv (Israel), #Doha (Qatar), #Kuwait City (Kuwait), #Dubai (United Arab Emirates), #Sharjah (United Arab Emirates), #Abu_Dhabi (United Arab Emirates), and #Dammam (Saudi Arabia). The suspension will remain in effect until further notice. The airline urged passengers traveling to or from the affected region to regularly check their flight status through its official digital platforms to avoid inconvenience. Earlier today it was reported that at least one Ethiopian national is among 58 people injured in the United Arab Emirates (UAE) following a series of.... Read more: https://addisstandard.com/?p=55477