Message125517
Actually, making PyMapping_Check() more robust produces a test failure in test_builtin, because of the following code:
# Verify locals stores (used by list comps)
eval('[locals() for i in (2,3)]', g, d)
eval('[locals() for i in (2,3)]', g, collections.UserDict())
class SpreadSheet:
"Sample application showing nested, calculated lookups."
_cells = {}
def __setitem__(self, key, formula):
self._cells[key] = formula
def __getitem__(self, key):
return eval(self._cells[key], globals(), self)
ss = SpreadSheet()
ss['a1'] = '5'
ss['a2'] = 'a1*6'
ss['a3'] = 'a2*7'
self.assertEqual(ss['a3'], 210)
Should I fix the example to include a keys() method? |
|
Date |
User |
Action |
Args |
2011-01-06 07:52:10 | pitrou | set | recipients:
+ pitrou, gvanrossum, georg.brandl, rhettinger, benjamin.peterson, jmillikin |
2011-01-06 07:52:10 | pitrou | set | messageid: <1294300330.52.0.543209371085.issue5945@psf.upfronthosting.co.za> |
2011-01-06 07:52:07 | pitrou | link | issue5945 messages |
2011-01-06 07:52:07 | pitrou | create | |
|