Variable alternates whether or not it exists in Python Debugger

后端 未结 2 1388
南方客
南方客 2021-01-22 00:05

Can anyone explain this? (Python 2.7, Django 1.7)

foo = data[\'selected_items\']
(Pdb) foo
(Pdb) *** NameError: name \'foo\' is not defined
foo
(Pdb) u\'1,2\'
fo         


        
2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-22 00:45

    When the statement appears in PDB, it hasn't actually been executed yet. It will be executed once you use 'next'.

提交回复
热议问题