Message145167
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. |
|
Date |
User |
Action |
Args |
2011-10-08 12:42:23 | dmascialino | set | recipients:
+ dmascialino, loewis, jjconti, ezio.melotti, eric.araujo |
2011-10-08 12:42:22 | dmascialino | link | issue8087 messages |
2011-10-08 12:42:22 | dmascialino | create | |
|