Как работает функция 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
⏸ The Official DeckForge Gameplay Trailer is Here!
Our official gameplay trailer is finally here — your first true glimpse into the chaos, beauty & raw power of the DeckForge multiverse.
🔵Where explosive combos ignite,
🔵where Bosses rise from the Void,
🔵where Jokers are forged, broken, reborn & where Genesis begins.
This trailer marks the start of a new chapter — one that you will shape.
👀 Watch the trailer. Feel the energy. Step into the Forge.
Share your thoughts in the comments — we’re reading every single one.
Stay Forged! 🔥
#DeckForge#MobileGaming#GameplayReveal
Join the DeckForge Community:
🌐YouTube𝕏Twitter🎮Discord
👉Chat👉Announcements👉DeckForge
▶️DeckForge x RuStore Conference Recap
RuStore Mobile Conference has officially wrapped — and it was incredible.
🔵Over 1,000+ industry leaders, studios, publishers and creators gathered under one roof
🔵Our showcase zone was packed all day — tons of gameplay sessions, powerful feedback & new connections with top experts across CIS & Asia
🔵RuStore shared big insights on the future of their platform and expansion into Asian markets — and we’re thrilled to grow alongside them as one of the most anticipated cross-platform titles of 2026
🔵This year, RuStore held its first-ever awards for the best mobile apps and games.
Dozens of titles were recognized as the industry’s top performers
But we know one thing for sure: next year, DeckForge is taking its place on that stage!
Now it’s time to get back to the forge — polishing the upcoming release, preparing holiday events & crafting something truly special for our players.
Stay Forged 🔥
#DeckForge#RuStore#GameDev#MobileGaming
Join the DeckForge Community:
🌐YouTube𝕏Twitter🎮Discord
👉Chat👉Announcements👉DeckForge
🎮 KATTA YANGILIK: TapNation — Game Fest 2026 markazida!
Tayyor turing, geymerlar! Dunyoning eng yirik mobil o‘yin nashriyotlaridan biri bo‘lgan TapNation rasman Game Fest 2026 festivalida ishtirok etishini e’lon qiladi! 🚀
Bu shunchaki tadbir emas, bu mobil o‘yinlar olamidagi inqilobiy tajriba bo‘ladi. Biz bilan birga o‘yin sanoatining kelajagiga sho‘ng‘ing!
—————————
🎮 BIG NEWS: TapNation Takes Center Stage at Game Fest 2026!
Get ready, gamers! We are thrilled to officially announce that TapNation, one of the world’s leading mobile game publishers, will be lighting up Game Fest 2026! 🚀
This isn’t just an event; it’s an immersive journey into the future of mobile gaming. Join us as we push the boundaries of innovation and dive deep into the next generation of play
#TapNation#GameFest2026#MobileGaming#GamingCommunity#Gamedev#UzbekistanGaming#NewGames2026
Unlock unlimited fun & winning at Rummy24.
Download the App Now👉https://rummy24.sng.link/Averc/fcz2/lcft
.
.
.
#Rummy24#RummyApp#PlayRummy#UnlimitedFun#PlayRummy#onlinerummy#cardsgame#mobilegames#mobilegaming#mobilegame#cardgames#onlinegame#play#skills#win