Author: Manuel Jacob
Branch: refactor-str-types
Changeset: r64610:1ec0c56555fc
Date: 2013-05-25 00:23 +0200
http://bitbucket.org/pypy/pypy/changeset/1ec0c56555fc/

Log:    Rename internal methods.

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
@@ -38,10 +38,10 @@
         """ representation for debugging purposes """
         return "%s(%s)" % (w_self.__class__.__name__, ''.join(w_self.data))
 
-    def new(self, value):
+    def _new(self, value):
         return W_BytearrayObject(value)
 
-    def get_value(self):
+    def _self_value(self):
         return self.data
 
 
diff --git a/pypy/objspace/std/stringmethods.py 
b/pypy/objspace/std/stringmethods.py
--- a/pypy/objspace/std/stringmethods.py
+++ b/pypy/objspace/std/stringmethods.py
@@ -1,6 +1,12 @@
 class StringMethods(object):
     _mixin_ = True
 
+    def _new(self, value):
+        raise NotImplementedError
+
+    def _self_value(self):
+        raise NotImplementedError
+
     def descr_eq(self, space):
         pass
 
@@ -38,8 +44,7 @@
             if e.match(space, space.w_TypeError):
                 return NotImplemented
             raise
-        data = self.get_value()
-        return self.new(data * times)
+        return self._new(self._self_value() * times)
 
     def descr_getitem(self, space):
         pass
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to