accessing local variables from the pdb debugger

Jean-Michel Pichavant jeanmichel at sequans.com
Fri Dec 11 07:29:42 EST 2009


Lie Ryan wrote:
> On 12/11/2009 12:37 AM, Jean-Michel Pichavant wrote:
>> Diez B. Roggisch wrote:
>> By just inserting the print foo statement right after changing foo's
>> value, I've rolled back the value to 'foo' ??? A hell of a wtf pdb
>> feature !
>
> Apparently it's fixed in 2.7 and 3.1
>
> D:\Lie Ryan\Desktop>python27 d.py
> > d:\lie ryan\desktop\d.py(6)test()
> -> print(foo)
> (Pdb) foo = "bar"
> (Pdb) pp foo
> 'bar'
> (Pdb) c
> bar
>
> D:\Lie Ryan\Desktop>python27 d.py
> > d:\lie ryan\desktop\d.py(6)test()
> -> print(foo)
> (Pdb) foo = "bar"
> (Pdb) c
> bar
>
Thanks, that could mean it is a bug from pdb in python 2.5. I tried with 
ipython & python, same issue. I'll keep that in mind, sadly it concerns 
a basic feature of the debugger.

JM



More information about the Python-list mailing list