[pypy-commit] pypy default: returning None in __len__ is not acceptable; use a different operation

gutworth noreply at buildbot.pypy.org
Thu May 26 19:12:42 CEST 2011


Author: Benjamin Peterson <benjamin at python.org>
Branch: 
Changeset: r44523:59dbc231c86a
Date: 2011-05-26 12:24 -0500
http://bitbucket.org/pypy/pypy/changeset/59dbc231c86a/

Log:	returning None in __len__ is not acceptable; use a different
	operation

diff --git a/pypy/module/test_lib_pypy/test_tputil.py b/pypy/module/test_lib_pypy/test_tputil.py
--- a/pypy/module/test_lib_pypy/test_tputil.py
+++ b/pypy/module/test_lib_pypy/test_tputil.py
@@ -28,9 +28,9 @@
         from tputil import make_proxy 
         l = []
         tp = make_proxy(l.append, type=list)
-        x = len(tp)
+        x = tp[0:1]
         assert len(l) == 1
-        assert l[0].opname == '__len__'
+        assert l[0].opname == '__getslice__'
        
     def test_simple(self):
         from tputil import make_proxy 


More information about the pypy-commit mailing list