I think Steve's suggestion fails in this situation. Suppose wibble.py contains a function fn. Now do import wibble fn = wibble.fn # Modify and save wibble.py reload(wibble) fn()
I've posted a message to this effect in the original bug https://bugs.python.org/msg334553
Please note that the original poster, after the cause has been explained, is happy for the bug to be closed. https://bugs.python.org/msg334551
Perhaps move discussion back to https://bugs.python.org/issue35857.