Andreas Rossberg wrote:
On 11 June 2013 14:50, Tab Atkins Jr.<[email protected]> wrote:
On Tue, Jun 11, 2013 at 2:08 AM, Axel Rauschmayer<[email protected]> wrote:
And it becomes harder to distinguish the interfaces, should you
need to [1]. IMO, the purity argument also counts: this technique implies
that iterators are a subset of iterables, but that isn’t true: For
iterables, each invocation of `iterator` creates a new object, for
iterators, it doesn’t.
As noted in the first comment, it's trivial to check for the
difference in all well-behaved cases by just seeing if "obj ===
obj[iterator]()" is true or false.
That makes a terrible API, though. I think Axel has a valid point that
the distinction between iterators and iterables is fuzzy enough to be
more confusing and error-prone than useful.
Have you actually used Python or JS1.7 much, though?
Have to ask, since throwing "confusing" and "error-prone" charges
demands evidence or at least anecdotes.
/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss