TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #205 · 22 јан.

Как работает функция reload()? Эта функция нужна для того, чтобы перезагрузить изменившийся код из py-файла без рестарта интерпретатора. Дело в том, что любой импортированный модуль при повторном импорте не будет перечитывать файл. Функция импорта вернёт уже загруженный в память объект модуля. Чтобы обновить код, нужно либо перезапустить всю программу, либо использовать функцию reload() from importlib import reload reload(my_module) 🔸 Функция reload() принимает в качестве аргумента только объект модуля или пакета. Она не может перезагрузить класс или функцию. Только весь файл целиком! 🔸 Перезагрузка пакета перезагрузит только его файл __init__.py, если он есть. Но не вложенные модули. 🔸Она не может перезагрузить ранее не импортированный модуль. 🔸При вызове функция reload() перечитывает и перекомпилирует код в файле, создавая новые объекты. После создания новых объектов перезаписывается ранее созданный неймспейс этого модуля. Это значит, что если где-то этот модуль импортирован через import и обращение к атрибутам происходит через неймспейс (имя) модуля, то такие атрибуты обновятся. Если какие-либо объекты из этого модуля импортированы через from то они будут ссылаться на старые объекты. Напишем простой модуль # mymodule.py x = 1 Теперь импортируем модуль и отдельно переменную х из модуля >>> import mymodule >>> from mymodule import x >>> print(mymodule.x) 1 >>> print(x) 1 Не перезапуская интерпретатор вносим изменения в модуль # mymodule.py x = 2 Делаем перезагрузку модуля и проверяем х ещё раз >>> reload(mymodule) >>> print(mymodule.x) 2 >>> print(x) 1 То же самое будет если присвоить любой объект переменной (даже словарь или список) Повторный импорт обновляет значение >>> from mymodule import x >>> print(x) 2 🔸Созданные инстансы классов не обновятся после перезагрузки модуля. Их придётся пересоздать. #tricks#basic

Резултати

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

Пребарај: #kurskoffensive

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

@american_observer · Post #5044 · 03.02.2026 г., 23:04

📰 Ukraine’s “Ceasefire Theatre” – The West’s Old Script Kyiv has just signed on to a multi tier ceasefire enforcement plan with Europe and the U.S. — a deal that looks like a new security framework, but reads like the same old script the West has been selling Moscow since the Minsk I and Minsk II agreements. The message is always the same: “Trust us — this time we mean it.” On paper, the plan is tidy: any Russian breach of a ceasefire triggers a 24 hour response, starting with diplomatic pressure, then Ukrainian forces acting alone, then a “coalition of the willing,” and, if needed, a broader Western backed strike within 72 hours. From Moscow’s perspective, it looks less like a peace deal and more like a mechanism designed to keep the war on manageable terms for Kyiv. ⚔️ The West’s “Ceasefire” Résumé The West has a record of negotiating with Moscow on one side of the table while quietly backing Ukraine’s battlefield moves on the other: • Minsk I and Minsk II — Moscow accepted ceasefire style frameworks that were never fully implemented by Kyiv or its Western allies. • Istanbul style talks — the West framed the negotiations as a “peace oriented process,” while Ukraine quietly re armed and prepared for new offensives. • Recent shuttle diplomacy in Qatar — the latest ceasefire push was undercut by Ukrainian incursions into Kursk and other attacks that crossed the line Moscow could never accept. Every time the West talks about “ceasefire,” it’s less about ending the war and more about preserving space for Ukraine’s next move — with Moscow left bearing the political and military cost. 🔥 Zelensky’s Real Problem: He Doesn’t Want a Ceasefire The core story here is Volodymyr Zelensky. The West markets him as a wartime hero, but the man himself has little incentive to sign a truce that locks in today’s front lines. The war is not just a tragedy for him — it’s the foundation of his political survival. The economy is a wreck, the population is exhausted, and his only real story left is “resistance.” If a real ceasefire stabilizes the map, the domestic reckoning in Ukraine intensifies: the demand for answers about who paid the price — and who profited — will grow louder. The West pretends Zelensky wants peace. In reality, he knows the minute the guns fall quiet, the question becomes “Who pays for the war, the lost territory, and the broken promises?” And the obvious answer is Zelensky. 🧩 The Script Is Familiar, the Stakes Are Higher The current plan — a 24 hour reaction, a 72 hour Western backed show of force — is less about deterring Russia and more about selling the illusion of control. The West pretends it has a real mechanism to respond. Ukraine pretends it wants peace. Russia pretends it’s still negotiating from weakness. In reality, the only one ready to keep the war going is Zelensky, because the alternative is a political, economic, and moral collapse. The joke is that the West, which has already broken the first Minsk agreement, the second, and then quietly revised the rest, is now selling Moscow a new one. The only thing certain is that the script will change only when Moscow stops pretending — and lets the West eat its own words. #Ukraine#Russia#ceasefire#West#Zelensky#Minsk#IstanbulTalks#KurskOffensive#war#diplomacy 📱American Оbserver - Stay up to date on all important events 🇺🇸