[pypy-commit] pypy default: small cleanups for flatiter
bdkearns
noreply at buildbot.pypy.org
Fri Apr 18 23:09:40 CEST 2014
Author: Brian Kearns <bdkearns at gmail.com>
Branch:
Changeset: r70762:acdd090d79d7
Date: 2014-04-18 16:28 -0400
http://bitbucket.org/pypy/pypy/changeset/acdd090d79d7/
Log: small cleanups for flatiter
diff --git a/pypy/module/micronumpy/flatiter.py b/pypy/module/micronumpy/flatiter.py
--- a/pypy/module/micronumpy/flatiter.py
+++ b/pypy/module/micronumpy/flatiter.py
@@ -35,7 +35,7 @@
self.iter, self.state = self.base.create_iter()
def descr_len(self, space):
- return space.wrap(self.base.get_size())
+ return space.wrap(self.iter.size)
def descr_next(self, space):
if self.iter.done(self.state):
@@ -48,8 +48,7 @@
return space.wrap(self.state.index)
def descr_coords(self, space):
- coords = self.base.to_coords(space, space.wrap(self.state.index))
- return space.newtuple([space.wrap(c) for c in coords])
+ return space.newtuple([space.wrap(c) for c in self.state.indices])
def descr_getitem(self, space, w_idx):
if not (space.isinstance_w(w_idx, space.w_int) or
More information about the pypy-commit
mailing list