Author: Lukas Diekmann <[email protected]>
Branch: list-strategies
Changeset: r47484:bbc59e3c25ea
Date: 2011-03-22 13:23 +0100
http://bitbucket.org/pypy/pypy/changeset/bbc59e3c25ea/

Log:    Moved non-negative prove to get_positive_index

diff --git a/pypy/objspace/std/listobject.py b/pypy/objspace/std/listobject.py
--- a/pypy/objspace/std/listobject.py
+++ b/pypy/objspace/std/listobject.py
@@ -370,7 +370,6 @@
         w_list.setslice(start, step, slicelength, sequence_w)
 
     def insert(self, w_list, index, w_item):
-        assert index >= 0
         self.switch_to_integer_strategy(w_list)
         w_list.insert(index, w_item)
 
@@ -457,7 +456,6 @@
         w_list.append(w_item)
 
     def insert(self, w_list, index, w_item):
-        assert index >= 0
         l = self.cast_from_void_star(w_list.lstorage)
 
         if self.is_correct_type(w_item):
@@ -900,6 +898,7 @@
             where = 0
     elif where > length:
         where = length
+    assert where >= 0
     return where
 
 def list_append__List_ANY(space, w_list, w_any):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to