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

Greg Ewing greg.ewing at canterbury.ac.nz
Thu May 29 02:44:34 CEST 2008


Mike Klaas wrote:

In my perfect world, strings would be indicable and sliceable, but not iterable.

An object that was indexable but not iterable would be a very strange thing. If it has len and getitem, there's nothing to stop you iterating over it by hand anyway, so disallowing iter would just seem perverse.

A case could be made for strings being sliceable but neither indexable nor iterable, but it's probably too late to make such a radical change now.

-- Greg



More information about the Python-Dev mailing list