Author ncoghlan
Recipients dmascialino, eric.araujo, ezio.melotti, jjconti, loewis, ncoghlan
Date 2011-10-10.07:52:53
SpamBayes Score 6.15125e-12
Marked as misclassified No
Message-id <1318233174.46.0.680055221994.issue8087@psf.upfronthosting.co.za>
In-reply-to
Content
(just reviewing the idea here, not the current patch)

The problem of "stale code" (i.e. what was executed doesn't match what is displayed in the traceback) is a tricky and subtle one. There are a few different cases:

1. Source displayed does not match source on disk
- these cases do happen, but they're almost always due to straight up bugs in the linecache or traceback modules.
2. Source has been changed, but module has not been reloaded
- this is the case for "edited source file but forgot to reload module". I've certainly forgotten to do this myself, and I'm far from the only one. This is the case Diego's RFE targets, and I think it has some merit.
3. Source has been changed, module has been reloaded, but object reference is from previous version of module
- the patch doesn't detect this. There are various ways we *could* detect it, but they all involve some fairly significant changes to the way compilation and module import work.

Aspect 3 is a much deeper (and bigger) problem relating to native introspection support in function and class objects. But that doesn't make Diego's idea to improve Aspect 2 invalid - there have certainly been times when playing at the interactive prompt that such a warning would have reminded me that I needed to reload the module I was working on.
History
Date User Action Args
2011-10-10 07:52:54ncoghlansetrecipients: + ncoghlan, loewis, jjconti, ezio.melotti, eric.araujo, dmascialino
2011-10-10 07:52:54ncoghlansetmessageid: <1318233174.46.0.680055221994.issue8087@psf.upfronthosting.co.za>
2011-10-10 07:52:53ncoghlanlinkissue8087 messages
2011-10-10 07:52:53ncoghlancreate