[Python-3000] Making strings non-iterable

Aahz aahz at pythoncraft.com
Tue Apr 18 03:26:45 CEST 2006


On Mon, Apr 17, 2006, Ian Bicking wrote:
>
> Polymorphism between things that aren't similar is bad; in another
> context it is called implicit coersion, like '1'+2=='12'.  That's
> what string iteration looks like to me -- strings aren't sequences of
> strings.  It can be convenient to treat them like sequences, but lots
> of things can be convenient, including '1'+2=='12'.

But string iteration isn't about treating strings as sequences of
strings, it's about treating strings as sequences of characters.  The
fact that characters are also strings is the reason we have problems, but
characters are strings for other good reasons.  There's just no way
around that conundrum, and changing the current situation will only
exchange our current set of problems for another set.  Let's stick with
the devil we know.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"LL YR VWL R BLNG T S"


More information about the Python-3000 mailing list