arizvisa
@arizvisa
dice
Thu, Jun 20, 2024 12:27 AM
Thu, Jun 20, 2024 12:29 AM
heh,
Reloading packages (and their submodules) recursivel...
pretty sure you can just pop all the references to package and sub-packages from
sys.modules
and re-import...
python
python3
reload
modules
opensource
itsnothard
hacks
terriblehacks
fuckpython
arizvisa
@arizvisa
Thu, Jun 20, 2024 12:28 AM
...then to be sure (maybe), you can use
gc.get_referrers
on the base module (that you popped) to get all the dicts referencing it, and assign your newly imported package back into them.
載入新的回覆
pretty sure you can just pop all the references to package and sub-packages from
sys.modules
and re-import...python python3 reload modules opensource itsnothard hacks terriblehacks fuckpython
gc.get_referrers
on the base module (that you popped) to get all the dicts referencing it, and assign your newly imported package back into them.