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[i] 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[i] for i in range(len(agg))) for v in lstValues]) [Decimal("48.0")] >>> There seems to be some sort of scope problem in PDB. -- Dale Strickland-Clark -- http://mail.python.org/mailman/listinfo/python-list