[Python-ideas] Stack traces ought to flag when a module has been changed on disk
Michael Foord
fuzzyman at gmail.com
Wed Jan 30 12:34:32 EST 2019
On Wed, 30 Jan 2019 at 16:34, Alex Walters <tritium-list at sdamon.com> wrote:
>
>
> > -----Original Message-----
> > From: Python-ideas <python-ideas-bounces+tritium-
> > list=sdamon.com at python.org> On Behalf Of Jonathan Fine
> > Sent: Wednesday, January 30, 2019 6:40 AM
> > To: python-ideas <python-ideas at python.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.
Michael
> > 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
> > Python-ideas at python.org
> > https://mail.python.org/mailman/listinfo/python-ideas
> > Code of Conduct: http://python.org/psf/codeofconduct/
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
http://www.michaelfoord.co.uk/
May you do good and not evil
May you find forgiveness for yourself and forgive others
May you share freely, never taking more than you give.
-- the sqlite blessing http://www.sqlite.org/different.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20190130/1abd5696/attachment.html>
More information about the Python-ideas
mailing list