[issue7622] [patch] improve unicode methods: split() rsplit() and replace()
Antoine Pitrou
report at bugs.python.org
Sun Jan 3 19:13:44 CET 2010
Antoine Pitrou <pitrou at free.fr> added the comment:
The patch looks wrong for bytearrays. They are mutable, so you shouldn't return the original object as an optimization. Here is the current (unpatched) behaviour:
>>> a = bytearray(b"abc")
>>> b, = a.split()
>>> b is a
False
On the other hand, you aren't doing this optimization at all in the general case of stringlib_split() and stringlib_rsplit(), while it could be done.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7622>
_______________________________________
More information about the Python-bugs-list
mailing list