[Erp5-report] r32723 nicolas.dumazet - /erp5/trunk/products/ERP5Type/XMLMatrix.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Feb 18 09:12:41 CET 2010
Author: nicolas.dumazet
Date: Thu Feb 18 09:12:40 2010
New Revision: 32723
URL: http://svn.erp5.org?rev=32723&view=rev
Log:
use enumerate() when we need an iterator's item AND index
Modified:
erp5/trunk/products/ERP5Type/XMLMatrix.py
Modified: erp5/trunk/products/ERP5Type/XMLMatrix.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/XMLMatrix.py?rev=32723&r1=32722&r2=32723&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/XMLMatrix.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/XMLMatrix.py [utf8] Thu Feb 18 09:12:40 2010
@@ -494,12 +494,10 @@
if not self.index.has_key(cell_id):
return None
- i = 0
base_item = self.index[base_id]
- for my_id in kw:
+ for i, my_id in enumerate(kw):
if base_item[i].has_key(my_id):
cell_id += '_%s' % base_item[i][my_id]
- i += 1
else:
raise KeyError, 'Invalid key: %s' % str(kw)
More information about the Erp5-report
mailing list