2009/12/10 David-Sarah Hopwood <[email protected]>: > Mike Samuel wrote: >> Proxy based iterators work well with existing loop constructs though >> while ('next' in iterator) doSomething(iterator.next); > > I don't understand what advantage this has over > while (iterator.hasNext()) doSomething(iterator.next());
Sure. If there were a hasNext() method, that would work. Python does not have such a thing. > If next() has side-effects (moving to the next element), it shouldn't > be a getter. Fair enough. > -- > David-Sarah Hopwood ⚥ http://davidsarah.livejournal.com > > > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss > > _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

