Possible bug in pdb module in Python 3 when using list generators

前端 未结 3 2092
情话喂你
情话喂你 2020-12-14 08:06

After running this code in Python 3:

import pdb

def foo():
    nums = [1, 2, 3]
    a = 5
    pdb.set_trace()

foo()

The following expres

3条回答
  •  情话喂你
    2020-12-14 08:42

    I just can't understand why you would need to do the above if you are looking to produce a list of Trues for each element in seq then why not [True for x in seq] - I would guess that you need to assign a local copy first before trying this sort of thing.

提交回复
热议问题