[Patches] [Patch #102549] simpler, faster(!) implementation of string.join
noreply@sourceforge.net
noreply@sourceforge.net
Tue, 28 Nov 2000 00:26:23 -0800
Patch #102549 has been updated.
Project: python
Category: core (C code)
Status: Open
Summary: simpler, faster(!) implementation of string.join
Follow-Ups:
Date: 2000-Nov-27 12:40
By: mwh
Comment:
attempting to fix a but in string.join, I realised that I didn't understand the current implementation. So I rewrote it. In doing so, I found the bug, but as my rewrite seems to be a little faster I thought I'd submit it.
The additional clarity is the main point though.
-------------------------------------------------------
Date: 2000-Nov-27 13:32
By: gvanrossum
Comment:
Tim -- can you review this?
-------------------------------------------------------
Date: 2000-Nov-27 13:54
By: gvanrossum
Comment:
In Python-dev, /F says:
your patch changes the behaviour of join on non-standard sequences.
if you use join on a long synthetic sequence, your new version may run
out of memory where the old one worked just fine.
not sure that's a good idea.
-0
-------------------------------------------------------
Date: 2000-Nov-27 13:57
By: gvanrossum
Comment:
And then later:
looking again, this was obviously only true for the unicode version
(which uses PySequence_GetItem), not for the 8-bit string version
(which uses the PySequence_Fast API).
maybe we should change the 8-bit implementation instead?
if not, +1.
</F>
-------------------------------------------------------
Date: 2000-Nov-28 00:26
By: mwh
Comment:
oops - my code had a bug.
'sep'.join(['a','b']) would return 'asepbsep'.
-------------------------------------------------------
-------------------------------------------------------
For more info, visit:
http://sourceforge.net/patch/?func=detailpatch&patch_id=102549&group_id=5470