Brett Cannon added the comment:
As Victor pointed out, this is not really feasible at the object level. You can
work your way back up to reload a whole module, but it won't update the object
you passed in, which is just going to confuse users.
--
nosy: +brett.cannon
resolution: -> rej
STINNER Victor added the comment:
You can retrieve the module using sys.modules[symbol.__module__].
Example:
>>> from os import environ as ENV
>>> import imp, sys
>>> imp.reload(sys.modules[ENV.__module__])
>>> _.environ is ENV
False
But if you import symbols instead of modules, symbols will
New submission from anatoly techtonik:
It would be nice if reload() supported reloading of symbols imported with "from
module import ..." syntax. It is quite useful for development sessions, when
you patch and test your function on some set of unexpected input.
>>> from astdump import dumpattr