iterable terminology (for language lawyers)

Michele Simionato michele.simionato at gmail.com
Wed Mar 16 03:08:47 EST 2005


According to the standand library
(http://docs.python.org/lib/typeiter.html)
an *iterable* is something with an __iter__ method. This means that
strings
are *not* iterable. However I can loop over a string without problem
and I would
say that an iterable is anything I can iterate over. Of course I am
*not* proposing
we add __iter__ to strings (it is convenient for me to be able to
distinguish
strings from other "iterables", since more often than not a string
wants to
be treated as an atomic object). The reason why I ask for a
clarification is
that I am going to give a course at the ACCU conference, so I want to
make
sure I use the rigth terminology.

           Michele Simionato




More information about the Python-list mailing list