[pypy-commit] pypy refactor-str-types: Rename internal methods.

Manuel Jacob noreply at buildbot.pypy.org
Tue May 28 14:55:32 CEST 2013


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


More information about the pypy-commit mailing list