PDB scope problem

  • Thread starter Dale Strickland-Clark
  • Start date
D

Dale Strickland-Clark

While debugging with PDB earlier, I discovered this idiosyncracy:

(Pdb) lstValues
[[Decimal("1"), Decimal("47.0")]]
(Pdb) agg
[0, 1]
(Pdb) print list([sum(v for i in range(len(agg))) for v in lstValues])
*** NameError: global name 'v' is not defined
(Pdb)

However, the Python interpreter is happy with it if entered directly:
lstValues [[Decimal("1"), Decimal("47.0")]]
agg = [0,1]
print list([sum(v for i in range(len(agg))) for v in lstValues]) [Decimal("48.0")]


There seems to be some sort of scope problem in PDB.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top