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

> So you can't lose iteration without also losing subscripting.
>>
>
> Python here does a lot of things implicitly.  I always felt the (explicit)
> index operator in strings in many other languages sort of is syntactic
> sugar, in python it was taken to do literally the same things as on other
> objects.  But it does not have to be that way.
>

You can quibble with the original design choice, but unless you borrow
Guido's time machine, there's not much point to that discussion. Instead,
let's talk about the benefits and problems that your change proposal would
cause.

Benefits:
- no more accidentally using str as an iterable

Problems:
- any code that subscripts, slices, or iterates over a str will break

Did I leave anything out?
How would you weigh the benefits against the problems?
How would you manage the upgrade path for code that's been broken?
_______________________________________________
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