Explorar o código

Fix __iter__ method of the Ilist class, now return an iterator

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@55451 15284696-431f-4ddb-bdfa-cd5b030d7da7
Pietro Zambelli %!s(int64=12) %!d(string=hai) anos
pai
achega
fd9f8f6d03
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      lib/python/pygrass/vector/basic.py

+ 1 - 1
lib/python/pygrass/vector/basic.py

@@ -281,7 +281,7 @@ class Ilist(object):
         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__())