[pypy-svn] r78391 - pypy/branch/bisect-module/pypy/module/_bisect

arigo at codespeak.net arigo at codespeak.net
Thu Oct 28 12:17:39 CEST 2010


Author: arigo
Date: Thu Oct 28 12:17:38 2010
New Revision: 78391

Modified:
   pypy/branch/bisect-module/pypy/module/_bisect/app_bisect.py
Log:
Recorder things that way.  Should fix CPython's test_bisect.py.


Modified: pypy/branch/bisect-module/pypy/module/_bisect/app_bisect.py
==============================================================================
--- pypy/branch/bisect-module/pypy/module/_bisect/app_bisect.py	(original)
+++ pypy/branch/bisect-module/pypy/module/_bisect/app_bisect.py	Thu Oct 28 12:17:38 2010
@@ -8,7 +8,8 @@
 
 Optional args lo (default 0) and hi (default len(a)) bound the
 slice of a to be searched."""
-    a.insert(bisect_left(a, x, lo, hi), x)
+    n = bisect_left(a, x, lo, hi)
+    a.insert(n, x)
 
 
 def insort_right(a, x, lo=0, hi=-1):
@@ -18,4 +19,5 @@
 
 Optional args lo (default 0) and hi (default len(a)) bound the
 slice of a to be searched."""
-    a.insert(bisect_right(a, x, lo, hi), x)
+    n = bisect_right(a, x, lo, hi)
+    a.insert(n, x)



More information about the Pypy-commit mailing list