On Tue, Apr 12, 2011 at 11:01 AM, Djoume Salvetti <[email protected]> wrote:
> On Tue, Apr 12, 2011 at 1:22 PM, Guido van Rossum <[email protected]> wrote:
>>
>> Looking at the pastebin you are using !lv = 2. Why the !? Without it,
>> it works fine:
>>
>
>
> I just wanted to make sure I was executing a python statement and not a pdb
> alias.
> I re-tested without the exclamation mark and still have the same issue:
>  -> import pdb; pdb.set_trace()
> (Pdb) list
>   1     gv = 1
>   2
>   3     def f():
>   4         lv = 1
>   5  ->     import pdb; pdb.set_trace()
>   6
>   7     if __name__ == '__main__':
>   8         f()
> [EOF]
> (Pdb) lv
> 1
> (Pdb) lv = 2
> (Pdb) lv
> 1
> (Pdb)

Interesting. You'll find that if you let the function continue, lv is
actually set to 2. Why pdb prints 1 I don't know. It might be
interesting to find out why that is, although since it's fixed in
Python 2.7 and Python 3, perhaps observing the changes in pdb.py (or
other related code) between Python 2.6 and 2.7 might be the quickest
way to find out.

-- 
--Guido van Rossum (python.org/~guido)
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to