[pypy-commit] pypy refactor-str-types: hg merge default

Manuel Jacob noreply at buildbot.pypy.org
Thu Jan 16 12:18:14 CET 2014


Author: Manuel Jacob
Branch: refactor-str-types
Changeset: r68695:e32ce09e64c1
Date: 2014-01-16 12:18 +0100
http://bitbucket.org/pypy/pypy/changeset/e32ce09e64c1/

Log:	hg merge default

diff --git a/pypy/doc/project-ideas.rst b/pypy/doc/project-ideas.rst
--- a/pypy/doc/project-ideas.rst
+++ b/pypy/doc/project-ideas.rst
@@ -74,6 +74,10 @@
 The actual details would be rather differen in PyPy, but we would like to have
 the same optimization implemented.
 
+Or maybe not.  We can also play around with the idea of using a single
+representation: as a byte string in utf-8.  (This idea needs some extra logic
+for efficient indexing, like a cache.)
+
 .. _`optimized unicode representation`: http://www.python.org/dev/peps/pep-0393/
 
 Translation Toolchain
diff --git a/rpython/annotator/binaryop.py b/rpython/annotator/binaryop.py
--- a/rpython/annotator/binaryop.py
+++ b/rpython/annotator/binaryop.py
@@ -435,6 +435,11 @@
         return SomeChar(no_nul=no_nul)
 
 
+class __extend__(pairtype(SomeChar, SomeUnicodeCodePoint),
+                 pairtype(SomeUnicodeCodePoint, SomeChar)):
+    def union((uchr1, uchr2)):
+        return SomeUnicodeCodePoint()
+
 class __extend__(pairtype(SomeUnicodeCodePoint, SomeUnicodeCodePoint)):
     def union((uchr1, uchr2)):
         return SomeUnicodeCodePoint()


More information about the pypy-commit mailing list