[pypy-commit] pypy py3.5: Obscure annotation fixes: propagate no_nul a tiny bit more

arigo pypy.commits at gmail.com
Wed Dec 20 06:15:28 EST 2017


Author: Armin Rigo <arigo at tunes.org>
Branch: py3.5
Changeset: r93511:2bd764ec6d22
Date: 2017-12-20 10:29 +0100
http://bitbucket.org/pypy/pypy/changeset/2bd764ec6d22/

Log:	Obscure annotation fixes: propagate no_nul a tiny bit more

diff --git a/rpython/annotator/binaryop.py b/rpython/annotator/binaryop.py
--- a/rpython/annotator/binaryop.py
+++ b/rpython/annotator/binaryop.py
@@ -381,16 +381,14 @@
 class __extend__(pairtype(SomeChar, SomeUnicodeCodePoint),
                  pairtype(SomeUnicodeCodePoint, SomeChar)):
     def union((uchr1, uchr2)):
-        return SomeUnicodeCodePoint()
+        no_nul = uchr1.no_nul and uchr2.no_nul
+        return SomeUnicodeCodePoint(no_nul=no_nul)
 
 class __extend__(pairtype(SomeUnicodeCodePoint, SomeUnicodeCodePoint)):
     def union((uchr1, uchr2)):
         no_nul = uchr1.no_nul and uchr2.no_nul
         return SomeUnicodeCodePoint(no_nul=no_nul)
 
-    def add((chr1, chr2)):
-        return SomeUnicodeString()
-
 class __extend__(pairtype(SomeString, SomeUnicodeString),
                  pairtype(SomeUnicodeString, SomeString)):
     def mod((str, unistring)):


More information about the pypy-commit mailing list