Tim Peters firstname.lastname@example.org wrote:
So there's no pure win here. Python's current scheme is at least predictable, and by everyone, with finite effort. Agree you have a particular good but limited use it for it, though, and Greg's suggestion of using buffer objects under the covers is almost certainly "the right" idea.
hmm. I'm not so sure about that...
with Greg's scheme, SRE needs to create a list full of buffer objects, while the SliceList scheme involves creating *one* object per substitution -- and to create that object, SRE only needs to copy slots from the match and substitution objects, and bump the reference counts.
(...and btw, using raw buffer objects to point into a set of strings of mixed types doesn't sound right to me...)
I think I'll stick to the SliceList model, with or without explicit support in the string join methods.