[Python-Dev] Crazy idea for str.join
Edward Loper
edloper at gradient.cis.upenn.edu
Sat Apr 29 15:59:15 CEST 2006
Josiah Carlson wrote:
> [...] get str.join to support objects which
> implement the buffer interface as one of the items in the sequence?
>
> Something like:
>
> y = 'hello world'
> buf1 = buffer(y, 0, 5)
> buf2 = buffer(y, 6)
> print ''.join([buf1, buf2])
>
> should print "helloworld"
This is incompatible with the recent proposal making str.join
automatically str-ify its arguments. i.e.:
''.join(['a', 12, 'b']) -> 'a12b'.
I don't feel strongly about either proposal, I just thought I'd point
out that they're mutually exclusive.
-Edward
More information about the Python-Dev
mailing list