[pypy-svn] r50029 - pypy/branch/ghop-ropes-classes/pypy/rlib

vinogradov at codespeak.net vinogradov at codespeak.net
Sun Dec 23 10:59:32 CET 2007


Author: vinogradov
Date: Sun Dec 23 10:59:31 2007
New Revision: 50029

Modified:
   pypy/branch/ghop-ropes-classes/pypy/rlib/ropewrapper.py
Log:
Remove side effect from __add__ method

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	Sun Dec 23 10:59:31 2007
@@ -14,8 +14,9 @@
         return rope.eq (self._node, rope.LiteralStringNode(other))
     
     def __add__ (self, other):
-        self._node = self._node + other._node
-	return self 
+        result = RopeString('')
+        result._node = self._node + other._node
+	return result
 
 class RopeUnicode(object):
     pass



More information about the Pypy-commit mailing list