On 11/14/06, George Sakkis <[EMAIL PROTECTED]> wrote: > This is the python-3000 list; I don't aim at Python 2.x. Given that I > propose to *replace* itertools, not add an extra builtin (having them > both would be redundant and violates the one obvious way to do it > principle), it wouldn't be backwards compatible. As for the -1s, so > far most of them seem to oppose the inheritance idea as a worse option > than duck typing; let's see if removing this part changes anything.
Yes, and at first glance, an IterMixin would be nice. But only at first glance. (1) Things that are already iterators won't implement the entire newly expanded iteration API. I don't want people to start mechanically replacing for var in seq with for var in Iter(seq) just because they can't remember whether or not it matters. (2) Some of the functionality in itertools (particularly islice) is awkward enough that maybe it should be hidden in a library. That way people are less likely to stumble on it without seeing the documentation. (3) IterMixin would be the only mixin exposed as a builtin -- the other mixins must be imported. The builtin type factories are typically the stripped down versions. -jJ _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com