[issue21377] PyBytes_Concat could try to concat in-place

2014-05-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6234f4caba57 by Zachary Ware in branch 'default': Issue #21442: Fix MSVC compiler warning introduced by issue21377. http://hg.python.org/cpython/rev/6234f4caba57 -- ___ Python tracker

[issue21377] PyBytes_Concat could try to concat in-place

2014-05-01 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs

[issue21377] PyBytes_Concat could try to concat in-place

2014-05-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4ed1b6c7e2f3 by Antoine Pitrou in branch 'default': Issue #21377: PyBytes_Concat() now tries to concatenate in-place when the first argument has a reference count of 1. http://hg.python.org/cpython/rev/4ed1b6c7e2f3 -- nosy: +python-dev ___

[issue21377] PyBytes_Concat could try to concat in-place

2014-05-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thanks! The latest patch looks fine to me. -- ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue21377] PyBytes_Concat could try to concat in-place

2014-04-30 Thread Nikolaus Rath
Changes by Nikolaus Rath : Added file: http://bugs.python.org/file35123/issue_21377_r4.diff ___ Python tracker ___ ___ Python-bugs-list mailin

[issue21377] PyBytes_Concat could try to concat in-place

2014-04-29 Thread Nikolaus Rath
Changes by Nikolaus Rath : Added file: http://bugs.python.org/file35100/issue_21377_r3.diff ___ Python tracker ___ ___ Python-bugs-list mailin

[issue21377] PyBytes_Concat could try to concat in-place

2014-04-29 Thread STINNER Victor
STINNER Victor added the comment: If I remember correctly, ceval.c has an optmisation for str += str even if the refcount is 2. Do we need to implement it or suggest to use bytearray or b''.join() instead? -- ___ Python tracker

[issue21377] PyBytes_Concat could try to concat in-place

2014-04-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: > If I remember correctly, ceval.c has an optmisation for str += str even if > the refcount is 2. Do we need to implement it or suggest to use bytearray > or b''.join() instead? The latter, IMO. This issue is about the C API _PyBytes_Concat. -- ___

[issue21377] PyBytes_Concat could try to concat in-place

2014-04-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Tentative patch attached. The test suite still passes, but I'm not > sure if it actually exerts the new code path. A quick grep shows me that it should be exercised at least by Modules/_io/bufferedio.c. Otherwise, the way to test the C API is to add a functio

[issue21377] PyBytes_Concat could try to concat in-place

2014-04-28 Thread Nikolaus Rath
Changes by Nikolaus Rath : Added file: http://bugs.python.org/file35085/issue_21377_r2.diff ___ Python tracker ___ ___ Python-bugs-list mailin

[issue21377] PyBytes_Concat could try to concat in-place

2014-04-28 Thread Nikolaus Rath
Nikolaus Rath added the comment: Tentative patch attached. The test suite still passes, but I'm not sure if it actually exerts the new code path. Is there a standard way to test the C api? -- keywords: +patch Added file: http://bugs.python.org/file35084/issue_21377.diff ___

[issue21377] PyBytes_Concat could try to concat in-place

2014-04-28 Thread Antoine Pitrou
New submission from Antoine Pitrou: Currently, PyBytes_Concat always creates a new bytes object for the result. However, when Py_REFCNT(*pv) == 1, it could instead call _PyBytes_Resize() and then concat the second argument in place. (like e.g. _PyUnicode_Append does) -- components: In