This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author dmascialino
Recipients dmascialino, eric.araujo, ezio.melotti, jjconti, loewis
Date 2011-10-08.12:42:22
SpamBayes Score 1.978797e-09
Marked as misclassified No
Message-id <CAN+O6V3i0291yy59_QpvfHjwpas4O_-2vL1RSqhUHoCfGgQDwA@mail.gmail.com>
In-reply-to <1318019105.32.0.409360495996.issue8087@psf.upfronthosting.co.za>
Content
On Fri, Oct 7, 2011 at 5:25 PM, Ezio Melotti <report@bugs.python.org> wrote:
>
> Ezio Melotti <ezio.melotti@gmail.com> added the comment:
>
> I'm not sure this is useful to have.  If you changed your code you know that you have to reload, so why would you want a warning that tells you that you changed the code?

The source line showed in the traceback could not be the same line
executed.

Take a look to this example:

k.py:
def f():
    a,b,c = 1,2

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "k.py", line 2, in f
    a,b,c = 1,2
ValueError: need more than 2 values to unpack

k.py:
def f():
    # blah
    a,b = 1,2

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "k.py", line 2, in f
    # blah
ValueError: need more than 2 values to unpack

> For some reason I always had the opposite problem (i.e. after a reload the traceback was still showing the original code, and not the new one), while IIUC you are saying that it shows the new code even if the module is not reloaded.
> I tried your code and indeed it does what you say, so either I am mistaken and I've been misreading the tracebacks, or this changed from 2.6 to 2.7, or in some cases even the behavior (I think) I observed might happen.
> I'll have to verify this next time it happens.

That is strange, I think Python does not save the original code in any place.
History
Date User Action Args
2011-10-08 12:42:23dmascialinosetrecipients: + dmascialino, loewis, jjconti, ezio.melotti, eric.araujo
2011-10-08 12:42:22dmascialinolinkissue8087 messages
2011-10-08 12:42:22dmascialinocreate