[pypy-svn] r50114 - pypy/branch/ghop-ropes-classes/pypy/rlib
cfbolz at codespeak.net
cfbolz at codespeak.net
Tue Dec 25 21:23:17 CET 2007
Author: cfbolz
Date: Tue Dec 25 21:23:17 2007
New Revision: 50114
Modified:
pypy/branch/ghop-ropes-classes/pypy/rlib/ropewrapper.py
Log:
share some more code
Modified: pypy/branch/ghop-ropes-classes/pypy/rlib/ropewrapper.py
==============================================================================
--- pypy/branch/ghop-ropes-classes/pypy/rlib/ropewrapper.py (original)
+++ pypy/branch/ghop-ropes-classes/pypy/rlib/ropewrapper.py Tue Dec 25 21:23:17 2007
@@ -19,6 +19,9 @@
def __ne__(self, other):
return not self == other
+ def __mul__(self, n):
+ return self.__class__(rope.multiply(self._node, n))
+
class RopeStringIterator(object):
def __init__(self, node):
self._iter = rope.ItemIterator(node)
@@ -44,9 +47,6 @@
def __add__(self, other):
return RopeString(self._node + other._node)
- def __mul__(self, n):
- return RopeString(rope.multiply(self._node, n))
-
def __eq__(self, other):
if isinstance(other, RopeBaseString):
return (rope.eq(self._node, other._node))
@@ -87,8 +87,5 @@
def __add__(self, other):
return RopeUnicode(self._node + other._node)
- def __mul__(self, n):
- return RopeUnicode(rope.multiply(self._node, n))
-
def __iter__(self):
return RopeUnicodeIterator(self._node)
More information about the Pypy-commit
mailing list