[pypy-commit] pypy py3.3: Propagage no_nul when merging SomeUnicodeStrings

amauryfa noreply at buildbot.pypy.org
Sun Jun 28 16:40:19 CEST 2015


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: py3.3
Changeset: r78339:0b8affef4e82
Date: 2015-06-28 16:40 +0200
http://bitbucket.org/pypy/pypy/changeset/0b8affef4e82/

Log:	Propagage no_nul when merging SomeUnicodeStrings

diff --git a/rpython/annotator/binaryop.py b/rpython/annotator/binaryop.py
--- a/rpython/annotator/binaryop.py
+++ b/rpython/annotator/binaryop.py
@@ -611,8 +611,9 @@
                  pairtype(SomeUnicodeString, SomeUnicodeCodePoint),
                  pairtype(SomeUnicodeString, SomeUnicodeString)):
     def union((str1, str2)):
-        return SomeUnicodeString(can_be_None=str1.can_be_none() or
-                                 str2.can_be_none())
+        can_be_None = str1.can_be_None or str2.can_be_None
+        no_nul = str1.no_nul and str2.no_nul
+        return SomeUnicodeString(can_be_None=can_be_None, no_nul=no_nul)
 
     def add((str1, str2)):
         # propagate const-ness to help getattr(obj, 'prefix' + const_name)


More information about the pypy-commit mailing list