Author: Simon Cross <[email protected]>
Branch: remove-string-smm
Changeset: r62628:e1b6bf1f9b9b
Date: 2013-03-22 02:17 +0200
http://bitbucket.org/pypy/pypy/changeset/e1b6bf1f9b9b/

Log:    Use index unwrap_spec type for index in bytearray.remove.

diff --git a/pypy/objspace/std/bytearraytype.py 
b/pypy/objspace/std/bytearraytype.py
--- a/pypy/objspace/std/bytearraytype.py
+++ b/pypy/objspace/std/bytearraytype.py
@@ -56,15 +56,14 @@
     return space.wrap(ord(result))
 
 
-@unwrap_spec(w_self=W_Root)
-def bytearray_remove(w_self, space, w_index):
+@unwrap_spec(w_self=W_Root, value='index')
+def bytearray_remove(w_self, space, value):
     """B.remove(int) -> None
 
     Remove the first occurance of a value in B.
     """
-    val = space.int_w(space.index(w_index))
     try:
-        w_self.data.remove(chr(val))
+        w_self.data.remove(chr(value))
     except ValueError:
         raise OperationError(space.w_ValueError, space.wrap(
             "value not found in bytearray"))
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to