[Python-3000] [Python-Dev] Iterable String Redux (aka String ABC)

Benji York benji at benjiyork.com
Tue May 27 22:09:47 CEST 2008


On Tue, May 27, 2008 at 3:42 PM, Guido van Rossum <guido at python.org> wrote:
> [+python-3000]
>
> On Tue, May 27, 2008 at 12:32 PM, Armin Ronacher
> <armin.ronacher at active-4.com> wrote:
>> Basically *the* problematic situation with iterable strings is something like
>> a `flatten` function that flattens out every iterable object except of strings.
>> Imagine it's implemented in a way similar to that::
>
> I'm not against this, but so far I've not been able to come up with a
> good set of methods to endow the String ABC with. Another problem is
> that not everybody draws the line in the same place -- how should
> instances of bytes, bytearray, array.array, memoryview (buffer in 2.6)
> be treated?

Maybe the opposite approach would be more fruitful.  Flattening is about
removing nested "containers", so perhaps there should be an ABC that
things like lists and tuples provide, but strings don't.  No idea what
that might be.
-- 
Benji York


More information about the Python-3000 mailing list