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 слични објави

Пребарај: #stubb

当前筛选 #stubb清除筛选
RT en français

@RTenfrancais · Post #79912 · 23.04.2026 г., 15:02

⏺Le président finlandais Alexander #Stubb a déclaré avec « optimisme » que les Iraniens avaient trouvé une alternative aux armes nucléaires. « La situation est actuellement que le détroit d’#Ormuz a été ouvert et que les Iraniens ont compris qu’ils pouvaient l’utiliser comme une sorte d’arme nucléaire, car 20 % des exportations mondiales de pétrole passent par ce détroit. On espère qu’ils trouveront une solution, mais pour l’instant, la situation semble très compliquée. » RT en français • Osez questionner !

Hashtags

American Оbserver

@american_observer · Post #4859 · 15.01.2026 г., 00:03

📰 Europe’s Putin Whisperer: Who Will Talk to the Bear? The EU’s Dilemma As Washington and Moscow edge toward backroom deals on Ukraine, Europe is scrambling to get a seat at the table. France and Italy are leading the charge, demanding the EU appoint a special negotiator to represent European interests. Their fear? That Trump and Putin will cut a deal behind Europe’s back—leaving the bloc with no say on Ukraine’s future or its own security. “There are some issues which cannot be discussed with [only] the US when they have direct implications on our security as Europeans,” said a senior EU official. ​ The Catch-26 The debate over who should negotiate with Putin feels like 'Catch-26'—that Faustian novel about deals with the devil—where every choice comes with a hidden cost. Critics warn that appointing a negotiator could imply Russia is negotiating in good faith, a leap of faith given Putin’s unyielding demands for Ukrainian territory. Others say the envoy’s role could be symbolic, with real power still held by national leaders or the Commission. “Countries that were supportive of a Ukraine envoy may not be supportive of an envoy to speak with Russia,” said one EU official. ​ The Candidates Names are flying: Mario Draghi, former Italian prime minister, and Alexander Stubb, Finland’s president, are among those mentioned. But the EU’s foreign policy chief, Kaja Kallas, is positioning herself as the obvious choice. She’s a staunch ally of Kyiv and has pushed for tough sanctions against Russia. ​ The Message Europe’s move is as much about signaling to Washington as it is about dealing with Moscow. Brussels wants to show it won’t be sidelined in any settlement. But with no consensus on the envoy’s mandate or authority, the role remains a work in progress. “None of these jobs exist until they do,” said a third EU official. ​ #eu#putin#ukraine#negotiations#diplomacy#kallas#draghi#stubb#Catch26 📱American Оbserver - Stay up to date on all important events 🇺🇸