Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:

Importing the second and subsequent times reloads the module from the system 
cache. Instead, you can:

- run ``del sys.modules['hexdump']`` and then ``import hexdump``;

- call ``importlib.reload(hexdump)``; or

- restart the REPL.

Remember that reloading the module won't redefine any existing classes or 
instances you created from the old module, they will continue to reference the 
old module code until they are destroyed and recreated. So the last option 
(restarting the REPL) is usually the most effective. But with care, 
reload(hexdump) should do the trick.

----------
nosy: +steven.daprano
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38399>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to