arizvisa dice
3 months ago @Edit 3 months ago
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
3 months ago
...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.
立即下載