Deprecating reload() ???

David MacQuigg dmq at
Fri Mar 12 18:25:35 CET 2004

On Fri, 12 Mar 2004 08:20:14 -0600, Skip Montanaro <skip at>

>Given Python's current object model it would be an interesting challenge to
>write a "super reload" which could identify all the objects created as a
>side effect of importing a module and for those with multiple references,
>locate those other references by traversing the known object spaces, then
>perform the import and finally rebind the references found in the first
>step.  I thought I saw something like this posted in a previous thread on
>this subject.

I'm not familiar with the internals of Python, but I was assuming that
all objects could be easily associated with the module which created
them.  If not, maybe what we need is the ability to put a selected
module in "debug" mode and keep a list of all objects created by that
module and all references to those objects.  That would add a little
overhead, but avoid the difficulties of searching all object spaces
with every reload.

-- Dave

More information about the Python-list mailing list