On Sat, Aug 20, 2016 at 5:27 PM Alexander Heger <pyt...@2sn.net> wrote:

> - any code that subscripts, slices, or iterates over a str will break
>>
>
> I would try to keep indexing and slicing, but not iterating.
>

So anything that wants to loop over a string character by character would
need to construct a new object, like ``for c in list(s)``? That seems
inefficient. I suppose you might advocate for a new type, some sort of
stringview that would allow iteration over a string, but avoid allocating
so much space as a list does, but that might bring us back to where we
started.


> The fixes overall will be a lot easier and obvious than introduction of
> unicode as default string type in Python 3.0.
>

That's a bold claim. Have you considered what's at stake if that's not true?

Anyway, why don't you write a proof of concept module for a non-iterable
string, throw it on PyPI, and see if people like using it?
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to