]> granicus.if.org Git - python/commit
Derivative of patch #102549, "simpler, faster(!) implementation of string.join".
authorTim Peters <tim.peters@gmail.com>
Fri, 19 Jan 2001 03:03:47 +0000 (03:03 +0000)
committerTim Peters <tim.peters@gmail.com>
Fri, 19 Jan 2001 03:03:47 +0000 (03:03 +0000)
commit19fe14e76ac3619e633b10c0e31effc2dad3c543
tree9a6355f1a18463a771ea59d8882ac20cbf30d296
parente3d6e41d81427a8e2bdda9bf3994c2c0c00c19a6
Derivative of patch #102549, "simpler, faster(!) implementation of string.join".
Also fixes two long-standing bugs (present in 2.0):
1. .join() didn't check that the result size fit in an int.
2. string.join(s) when len(s)==1 returned s[0] regardless of s[0]'s
   type; e.g., "".join([3]) returned 3 (overly optimistic optimization).
I resisted a keen temptation to make .join() apply str() automagically.
Objects/stringobject.c