Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r58919:98149fa2c607
Date: 2012-11-14 15:00 -0800
http://bitbucket.org/pypy/pypy/changeset/98149fa2c607/
Log: fix range __length_hint__, test_xrange -> test_range
diff --git a/pypy/module/__builtin__/functional.py
b/pypy/module/__builtin__/functional.py
--- a/pypy/module/__builtin__/functional.py
+++ b/pypy/module/__builtin__/functional.py
@@ -452,7 +452,7 @@
raise OperationError(space.w_StopIteration, space.w_None)
def descr_len(self, space):
- return space.sub(self.w_length, self.w_index)
+ return space.sub(self.w_len, self.w_index)
def descr_reduce(self, space):
from pypy.interpreter.mixedmodule import MixedModule
diff --git a/pypy/objspace/std/test/test_lengthhint.py
b/pypy/objspace/std/test/test_lengthhint.py
--- a/pypy/objspace/std/test/test_lengthhint.py
+++ b/pypy/objspace/std/test/test_lengthhint.py
@@ -90,11 +90,11 @@
space.call_method(w_reversed, '__length_hint__')) == self.SIZE
self._test_length_hint(w_reversed)
- def test_xrange(self):
+ def test_range(self):
space = self.space
- w_xrange = space.call_method(space.builtin, 'xrange',
+ w_range = space.call_method(space.builtin, 'range',
space.newint(self.SIZE))
- self._test_length_hint(w_xrange)
+ self._test_length_hint(w_range)
def test_itertools_repeat(self):
space = self.space
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit