<br><br><div><span class="gmail_quote">On 7/20/06, <b class="gmail_sendername">Greg Ewing</b> &lt;<a href="mailto:greg.ewing@canterbury.ac.nz">greg.ewing@canterbury.ac.nz</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Walter Dörwald wrote:<br><br>&gt; I don't know about __call__, but str and unicode don't have __iter__,<br>&gt; list, tuple and dict do:<br><br>That's probably because str and unicode don't do their<br>own iteration, but rely on the fallback implementation.
<br>In which case it's perfectly correct for them not to<br>have an __iter__ method.<br><br>If you want to test whether something is iterable, it's<br>not enough to test for __iter__ -- you also need to<br>test for __len__ and __getitem__ as an alternative.
<br>Which means it might make sense to have an iterable()<br>function which does that.<br><br>--<br>Greg<br>_______________________________________________<br>Python-3000 mailing list<br><a href="mailto:Python-3000@python.org">
Python-3000@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/python-3000">http://mail.python.org/mailman/listinfo/python-3000</a><br>Unsubscribe: <a href="http://mail.python.org/mailman/options/python-3000/brett%40python.org">
http://mail.python.org/mailman/options/python-3000/brett%40python.org</a><br></blockquote></div><br>