string: __iter__()?

mrquantum mrquantum at
Wed Oct 4 12:30:30 CEST 2006

Am Wed, 04 Oct 2006 11:59:07 +0200 schrieb mrquantum:

> Hello!
> Just for curiosity i'd like to know why strings don't support the
> iteration protocoll!? Is there some deeper reason for this?

Sorry, was to hasty by saying "... don't support the iteration
protocol'! Sure they do, as the iter('SomeString') function or the
construction for c in 'SomeString' show.

It's just not implemented by a __iter__ method of the string in question!

More information about the Python-list mailing list