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

Резултати

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

Пребарај: #sergeylavrov

当前筛选 #sergeylavrov清除筛选

@RusEmbMalta Press Release 🇷🇺Interview of Russian Foreign Minister Sergey Lavrov with Turkish Media 📍Moscow, 29 January 2026 On 29 January 2026, Russian Foreign Minister Sergey Lavrov gave an interview to Turkish media, outlining Russia’s principled assessment of the situation around Ukraine, the role of the West, and the prospects for a sustainable security architecture. 🔹 Key points 🧭 Ukraine and the West Russia views the Ukrainian conflict as part of a broader confrontation with the West. Ukraine has been turned into a pawn – a tool used to build a military bulwark along Russia’s borders, creating direct threats to Russian security. 📜Breach of Ukraine’s founding principles Ukraine’s Declaration of Independence explicitly enshrined non-alignment, neutrality and renunciation of nuclear weapons. It was precisely these principles that formed the basis on which Russia – along with most countries worldwide – recognised Ukraine after the dissolution of the Soviet Union. 🔹A conflict prepared in advance The crisis in Ukraine was not spontaneous. It was carefully prepared and financed, including by the United States. As former US Deputy Secretary of State Victoria Nuland has acknowledged, around USD 5 billion was spent to engineer a coup and transform Ukraine into an “anti-Russia” project. ⚠️ A tragic repetition of history The Zelensky regime represents a grim repetition of history — not a farce, but a tragedy, given the immense human toll. Many lives have been sacrificed by the regime and its Western patrons. ⛔Ceasefire proposals Russia considers unacceptable the repeated calls by Zelensky for a ceasefire of 60 days or longer. Past experience shows that such pauses were consistently exploited to rearm Ukraine, mobilise new recruits by force, regroup troops and prolong the conflict. 🕊️Missed opportunity in Istanbul (April 2022) Concrete and honest security guarantees were formulated during negotiations in Istanbul, hosted by Türkiye. These included the absence of foreign military bases on Ukrainian territory and restrictions on military exercises involving external forces. Everything was agreed in detail – but the process was blocked after external political interference. 📄So-called “peace plans” Russia has not seen the “20-point plan” repeatedly referenced by Zelensky. As understood, it has since been reworked by Ukraine and certain European states and is now being promoted as an alternative “vision” of peace. 🌍Multipolar world Russia does not oppose states that firmly defend their national interests. On the contrary, a truly multipolar world can only emerge through self-respecting states guided by common sense — states that defend their own interests while respecting those of others. 🔗 Full text of the interview: 👉here. #RussiaTürkiye #SergeyLavrov #UkraineCrisis

ሰርጌይ ላቭሮቭ ለ130ኛው የዓድዋ ድል በዓል የእንኳን አደረሳችሁ መልዕክት አስተላለፉ ******************** የሩሲያ የውጭ ጉዳይ ሚኒስትር ሰርጌይ ላቭሮቭ ለኢፌዴሪ የውጭ ጉዳይ ሚኒስትር ጌድዮን ጢሞቴዎስ (ዶ/ር) እና ለመላው የኢትዮጵያ ሕዝብ ለ130ኛው የዓድዋ ድል በዓል የእንኳን አደረሳችሁ መልዕክት አስተላልፈዋል። የውጭ ጉዳይ ሚኒስትሩ በመልዕክታቸው፤ የዓድዋ ድል በአፍሪካ ታሪክ አንዲት ሀገር በቅኝ ገዥ ኃይል ላይ የተቀዳጀችው የመጀመሪያው ድል በመሆኑ በዓለም አቀፍ ደረጃ ከፍተኛ ተጽዕኖ የፈጠረ መሆኑን ገልጸዋል። ድሉ የኢትዮጵያውያንን የጽናት መንፈስ ከማረጋገጡ ባለፈ በመላው አፍሪካ ለሚካሄዱ የነፃነት ትግሎች መነሻ መሆኑንም አክለዋል። ሩሲያ እና ኢትዮጵያ ለረጅም ዘመናት የዘለቀ የወዳጅነት ታሪክ እንዳላቸው የጠቀሱት ሰርጌይ ላቭሮቭ፤ በየተለያዩ ዓለም አቀፍ ድርጅቶች በተለይም በተባበሩት መንግሥታት ድርጅት እና በብሪክስ ማዕቀፍ ውስጥ ፍትሃዊ የዓለም ሥርዓት እንዲኖር በጋራ እየሠሩ መሆኑን ጠቁመዋል። በተጨማሪም በሁለቱ ሀገራት መካከል በንግድ፣ በኢኮኖሚ፣ በሳይንስ እና በባህል ዘርፎች ትብብሮች እያደጉ መሆናቸውን መግለጻቸውን የሩሲያ የውጭ ጉዳይ ሚኒስቴር መረጃ አመልክቷል። በኢትዮጵያ የኒውክሌር ኃይል ማመንጫ ግንባታን ጨምሮ፣ የደጃዝማች ባልቻ ሆስፒታልን መልሶ መገንባት እና የጋራ ባዮሎጂካል ምርምር ማዕከል መመሥረት ዋና ዋናዎቹ የትብብር ፕሮጀክቶች መሆናቸውን ሚኒስትሩ በመልዕክታቸው ጠቅሰዋል። #EBC#Ethiopia#Russia#Adwa130#Diplomacy#SergeyLavrov#GedionTimotheos#BRICS