On Wed, 30 Jan 2019 at 16:34, Alex Walters firstname.lastname@example.org wrote:
-----Original Message----- From: Python-ideas <python-ideas-bounces+tritium- email@example.com> On Behalf Of Jonathan Fine Sent: Wednesday, January 30, 2019 6:40 AM To: python-ideas firstname.lastname@example.org Subject: Re: [Python-ideas] Stack traces ought to flag when a module has been changed on disk
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 think using reload should raise warnings, since it doesn't work, and the reload case shouldn't be the killer of this really good idea.
Reload isn't the issue here. Even without the reload the call to `fun()` will no longer match the file on disk.
reload was moved to the imp module for exactly that reason.
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.
Jonathan _______________________________________________ Python-ideas mailing list Pythonemail@example.com https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
Python-ideas mailing list Pythonfirstname.lastname@example.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/