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

vinogradov at codespeak.net vinogradov at codespeak.net
Sun Dec 23 19:59:52 CET 2007


Author: vinogradov
Date: Sun Dec 23 19:59:51 2007
New Revision: 50048

Modified:
   pypy/branch/ghop-ropes-classes/pypy/rlib/ropewrapper.py
Log:
RopeUnicode constructor now accept *Rope as argument

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 19:59:51 2007
@@ -28,8 +28,11 @@
 class RopeUnicode(object):
     def __init__(self, s):
         if isinstance(s, str):
-            s = unicode(s)
-        self._node = rope.LiteralUnicodeNode(unicode(s))
+            self._node = rope.LiteralUnicodeNode(unicode(s))
+        if isinstance(s, unicode):
+            self._node = rope.LiteralUnicodeNode(s)
+        if isinstance(s, rope.LiteralUnicodeNode):
+            self._node = s
     
     def __len__(self):
         return self._node.length()



More information about the Pypy-commit mailing list