Romain Guillebert avatar Romain Guillebert committed f406998

Fix translation

Comments (0)

Files changed (2)


     def next(self):
         raise NotImplementedError("Abstract Class")
-    def getitem(self, array):
+    def getitem(self, space, array):
         raise NotImplementedError("Abstract Class")
 class IteratorMixin(object):
             if len(w_lst) != n:
                 raise OperationError(space.w_ValueError, space.wrap(
                    '%s must be a tuple or array of per-op flag-tuples' % name))
-            for item in space.listview(w_lst):
-                ret.append(parse_one_arg(space, item))
+            for item in w_lst:
+                ret.append(parse_one_arg(space, space.listview(item)))
             op_flag = parse_one_arg(space, w_lst)
             for i in range(n):
             nditer.zerosize_ok = True
             raise OperationError(space.w_ValueError, space.wrap(
-                    'Unexpected iterator global flag "%s"', item))
+                    'Unexpected iterator global flag "%s"' % item))
     if nditer.tracked_index and nditer.external_loop:
             raise OperationError(space.w_ValueError, space.wrap(
                 'Iterator flag EXTERNAL_LOOP cannot be used if an index or '
     if (imp.strides[0] < imp.strides[-1] and not backward) or \
        (imp.strides[0] > imp.strides[-1] and backward):
         # flip the strides. Is this always true for multidimension?
-        strides = [s for s in imp.strides[::-1]]
-        backstrides = [s for s in imp.backstrides[::-1]]
-        shape = [s for s in shape[::-1]]
+        strides = [imp.strides[i] for i in range(len(imp.strides) - 1, -1, -1)]
+        backstrides = [imp.backstrides[i] for i in range(len(imp.backstrides) - 1, -1, -1)]
+        shape = [imp.shape[i] for i in range(len(imp.shape) - 1, -1, -1)]
         strides = imp.strides
         backstrides = imp.backstrides


         if backward:
             self.slicesize = shape[0]
    = [support.product(shape[1:]) * dtype.get_size()]
-            self.strides = strides[1:][::-1]
-            self.backstrides = backstrides[1:][::-1]
-            self.shape = shape[1:][::-1]
+            self.strides = strides[1:]
+            self.backstrides = backstrides[1:]
+            self.shape = shape[1:]
+            self.strides.reverse()
+            self.backstrides.reverse()
+            self.shape.reverse()
             self.shapelen = len(self.shape)
             shape = [support.product(shape)]
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.