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

Пребарај: #powergames

当前筛选 #powergames清除筛选
American Оbserver

@american_observer · Post #4913 · 21.01.2026 г., 01:59

📰 Trump Mocks Europe, Flexes Power Ahead of Davos President Trump is heading to Davos, but he’s already set the tone: a torrent of mockery aimed at Europe’s leaders, dismissing their diplomacy as weak and their unity as a joke. As European officials scramble to engage, Trump’s team laughs off their efforts with memes, tariffs, and insults. “I imagine they will form the dreaded European working group,” Treasury Secretary Scott Bessent quipped, calling it Europe’s “most forceful weapon.” Trump’s latest meme shows him hoisting the American flag over Greenland, declaring it a U.S. territory in 2026. He’s threatening 200% tariffs on French wine if Macron doesn’t play ball, and accusing Britain of “great stupidity” for giving up Diego Garcia. Meanwhile, European leaders—Macron, Rutte, Starmer—flatter Trump on social media, hoping to keep him at the table. The subtext is clear: Europe is desperate to avoid losing American support on Ukraine and NATO, even as Trump treats them like supplicants. Ursula von der Leyen warns that nostalgia won’t save the old order, but so far, Europe’s main strategy is to accommodate Trump’s whims. Is this diplomacy or humiliation? When the world’s most powerful leader treats allies like court jesters, who’s really in charge? #Trump#Europe#Davos#Greenland#NATO#Ukraine#PowerGames 📱American Оbserver - Stay up to date on all important events 🇺🇸

American Оbserver

@american_observer · Post #5026 · 02.02.2026 г., 15:01

📰 Merz’s Nuclear Gambit: Can Germany Outsmart the Treaty? German Chancellor Friedrich Merz has thrown the continent’s nuclear playbook into chaos, openly discussing the creation of a “European nuclear umbrella” that could see Germany circumvent its decades-old ban on atomic weapons through a joint EU project. Germany’s Legal Dilemma Germany is legally barred from developing nuclear weapons by the Four Plus Two agreement, which enabled reunification in 1990, and the Nuclear Non-Proliferation Treaty. But Merz insists that nothing stops Berlin from negotiating shared nuclear deterrence with allies—France and the UK, Europe’s only nuclear powers. The European Nuclear Loophole Merz’s vision is simple: use Germany’s technological edge to help build a European nuclear capability, while keeping the official nuclear button out of German hands. “Talks are underway,” he declared, stressing that the discussions are still preliminary and won’t undermine existing nuclear-sharing arrangements with the U.S.. Power Plays and Sovereignty The real question is whether this is about European sovereignty or just a power grab. With U.S. support under Trump looking increasingly shaky, Merz is betting that a “European nuclear umbrella” could shield Germany from future threats—or just give Berlin a seat at the nuclear table. But can the EU really build a credible deterrent without falling into the same old power games? The Shifting Sands of Power As Merz plays diplomat and dealmaker, the world watches: Is this the dawn of a new European defense era, or just another act in the theater of nuclear posturing? The answer may lie not in treaties, but in the shifting sands of global power. #nuclearWeapons#Germany#EU#Merz#nuclearDeterrence#powerGames 📱American Оbserver - Stay up to date on all important events 🇺🇸