Author: Brian Kearns <bdkea...@gmail.com>
Branch: refactor-buffer-api
Changeset: r70930:69b1380478f3
Date: 2014-04-24 13:55 -0400
http://bitbucket.org/pypy/pypy/changeset/69b1380478f3/

Log:    cleanup

diff --git a/pypy/objspace/std/bytearrayobject.py 
b/pypy/objspace/std/bytearrayobject.py
--- a/pypy/objspace/std/bytearrayobject.py
+++ b/pypy/objspace/std/bytearrayobject.py
@@ -58,10 +58,10 @@
             raise oefmt(space.w_IndexError, "bytearray index out of range")
         return space.wrap(ord(character))
 
-    def _val(self, space):
-        return space.buffer_w(self, space.BUF_SIMPLE).as_str()
+    _val = charbuf_w
 
-    def _op_val(self, space, w_other):
+    @staticmethod
+    def _op_val(space, w_other):
         return space.buffer_w(w_other, space.BUF_SIMPLE).as_str()
 
     def _chr(self, char):
diff --git a/pypy/objspace/std/bytesobject.py b/pypy/objspace/std/bytesobject.py
--- a/pypy/objspace/std/bytesobject.py
+++ b/pypy/objspace/std/bytesobject.py
@@ -477,8 +477,7 @@
     def _len(self):
         return len(self._value)
 
-    def _val(self, space):
-        return self._value
+    _val = str_w
 
     @staticmethod
     def _op_val(space, w_other):
diff --git a/pypy/objspace/std/unicodeobject.py 
b/pypy/objspace/std/unicodeobject.py
--- a/pypy/objspace/std/unicodeobject.py
+++ b/pypy/objspace/std/unicodeobject.py
@@ -100,10 +100,10 @@
     def _len(self):
         return len(self._value)
 
-    def _val(self, space):
-        return self._value
+    _val = unicode_w
 
-    def _op_val(self, space, w_other):
+    @staticmethod
+    def _op_val(space, w_other):
         if isinstance(w_other, W_UnicodeObject):
             return w_other._value
         if space.isinstance_w(w_other, space.w_str):
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to