Kurda Yon <[EMAIL PROTECTED]> writes:

> Is there a way to force Python to re-import the function, i.e. to
> force it to use the new version of the function?

A Python ‘import’ is conceptually two steps: execute the module, then
bind the objects that were created to names in a namespace.

The import mechanism has a short-cut: if the module has already been
imported by this Python VM, the module isn't executed again, and the
existing objects are simply re-used with new bindings as necessary.

What you want is to specifically request the module to be re-executed
to re-create the objects again, and re-bind the existing name bindings
to the objects that result.

   >>> help(reload)

-- 
 \     “I hope that after I die, people will say of me: ‘That guy sure |
  `\                            owed me a lot of money’.” —Jack Handey |
_o__)                                                                  |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to