Author: Matti Picus <[email protected]>
Branch: 
Changeset: r91418:7328ebef4d73
Date: 2017-05-26 16:38 +0300
http://bitbucket.org/pypy/pypy/changeset/7328ebef4d73/

Log:    do not go through descroperation.binop_impl again, call descr_add
        directly

diff --git a/pypy/objspace/std/bytesobject.py b/pypy/objspace/std/bytesobject.py
--- a/pypy/objspace/std/bytesobject.py
+++ b/pypy/objspace/std/bytesobject.py
@@ -648,7 +648,7 @@
         if space.isinstance_w(w_other, space.w_unicode):
             self_as_unicode = unicode_from_encoded_object(space, self, None,
                                                           None)
-            return space.add(self_as_unicode, w_other)
+            return self_as_unicode.descr_add(space, w_other)
         elif space.isinstance_w(w_other, space.w_bytearray):
             # XXX: eliminate double-copy
             from .bytearrayobject import W_BytearrayObject, _make_data
diff --git a/pypy/objspace/std/test/test_bytesobject.py 
b/pypy/objspace/std/test/test_bytesobject.py
--- a/pypy/objspace/std/test/test_bytesobject.py
+++ b/pypy/objspace/std/test/test_bytesobject.py
@@ -846,3 +846,7 @@
                 return 42
         x = Foo()
         assert "hello" + x == 42
+
+    def test_add(self):
+        assert 'abc' + 'abc' == 'abcabc'
+        assert isinstance('abc' + u'\u03a3', unicode)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to