I understand the underlying implementation of str.join can be a bit convoluted (with the auto-promotion to unicode and all), but I don't suppose there is any chance to 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" It would take a PyBuffer_Check() just after the PyUnicode_Check() block. And one may be able to replace the other PyString_* calls with PyObject_AsCharBuffer() calls. I'm not going to push for this, but someone other than me may find such functionality useful. - Josiah P.S. One interesting thing to note is that quite a few underlying objects take buffer objects in lieu of strings, even when they aren't documented as doing so; file.write(), array.fromstring(), mmap[i:j] = buffer, etc.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4