[GRASS-SVN] r55451 - grass/trunk/lib/python/pygrass/vector

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Mar 19 08:24:31 PDT 2013


Author: zarch
Date: 2013-03-19 08:24:30 -0700 (Tue, 19 Mar 2013)
New Revision: 55451

Modified:
   grass/trunk/lib/python/pygrass/vector/basic.py
Log:
Fix __iter__ method of the Ilist class, now return an iterator

Modified: grass/trunk/lib/python/pygrass/vector/basic.py
===================================================================
--- grass/trunk/lib/python/pygrass/vector/basic.py	2013-03-19 15:24:30 UTC (rev 55450)
+++ grass/trunk/lib/python/pygrass/vector/basic.py	2013-03-19 15:24:30 UTC (rev 55451)
@@ -281,7 +281,7 @@
         return self.c_ilist.contents.n_values
 
     def __iter__(self):
-        return [self.c_ilist.contents.value[i] for i in xrange(self.__len__())]
+        return (self.c_ilist.contents.value[i] for i in xrange(self.__len__()))
 
     def __repr__(self):
         return "Ilist(%r)" % repr(self.__iter__())



More information about the grass-commit mailing list