Perhaps drawing a distinction between containers (or maybe &quot;collections&quot;?), and non-container iterables is appropriate?&nbsp; I would define containers as objects that can be iterated over multiple times and for which iteration does not instantiate new objects.&nbsp; By this definition generators would not be considered containers (but views would), and for practicality it may be worth also having an ABC for containers-and-generators (no idea what to name it).&nbsp; This would result in the following hierarchy:<br>
<br>iterables<br>- strings, bytes, etc.<br>- containers-and-generators<br>- - containers<br>- - - tuple, list, set, dict views, etc.<br>- - generators<br><br>I don&#39;t think there needs to be different operations defined for the different ABCs.&nbsp; They&#39;re all just iterables with different iteration semantics.<br>
<br>Jamie<br><br><div class="gmail_quote">On Tue, May 27, 2008 at 3:54 PM, Raymond Hettinger &lt;<a href="mailto:python@rcn.com">python@rcn.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&quot;Jim Jewett&quot; <br><div class="Ih2E3d">
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
It isn&#39;t really stringiness that matters, it is that you have to<br>
terminate even though you still have an iterable container.<br>
</blockquote>
<br></div>
Well said.<div class="Ih2E3d"><br>
<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Guido had at least a start in Searchable, back when ABC<br>
were still in the sandbox:<br>
</blockquote>
<br></div>
Have to disagree here. &nbsp;An object cannot know in general<br>
whether a flattener wants to split it or not. &nbsp;That is an application<br>
dependent decision. &nbsp;A better answer is be able to tell the<br>
flattener what should be considered atomic in a given circumstance.<br><font color="#888888">
<br>
<br>
Raymond</font><div><div></div><div class="Wj3C7c"><br>
_______________________________________________<br>
Python-3000 mailing list<br>
<a href="mailto:Python-3000@python.org" target="_blank">Python-3000@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-3000" target="_blank">http://mail.python.org/mailman/listinfo/python-3000</a><br>
Unsubscribe: <a href="http://mail.python.org/mailman/options/python-3000/jgennis%40gmail.com" target="_blank">http://mail.python.org/mailman/options/python-3000/jgennis%40gmail.com</a><br>
</div></div></blockquote></div><br>