[pypy-svn] r50116 - pypy/branch/ghop-ropes-classes/pypy/rlib
vinogradov at codespeak.net
vinogradov at codespeak.net
Tue Dec 25 21:30:37 CET 2007
Author: vinogradov
Date: Tue Dec 25 21:30:36 2007
New Revision: 50116
Modified:
pypy/branch/ghop-ropes-classes/pypy/rlib/ropewrapper.py
Log:
Move __add__ method to RopeBaseString class
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:30:36 2007
@@ -22,6 +22,9 @@
def __mul__(self, n):
return self.__class__(rope.multiply(self._node, n))
+ def __add__(self, other):
+ return self.__class__(self._node + other._node)
+
class RopeStringIterator(object):
def __init__(self, node):
self._iter = rope.ItemIterator(node)
@@ -44,9 +47,6 @@
def __getitem__(self, index):
return self._node.getchar(index)
- def __add__(self, other):
- return RopeString(self._node + other._node)
-
def __eq__(self, other):
if isinstance(other, RopeBaseString):
return (rope.eq(self._node, other._node))
@@ -83,9 +83,6 @@
return rope.eq(self._node, other._node)
else:
return rope.eq(self._node, rope.LiteralUnicodeNode(other))
-
- def __add__(self, other):
- return RopeUnicode(self._node + other._node)
def __iter__(self):
return RopeUnicodeIterator(self._node)
More information about the Pypy-commit
mailing list