[issue5034] itertools.fixlen

2009-01-26 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: -> rejected status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue5034] itertools.fixlen

2009-01-24 Thread Raymond Hettinger
Raymond Hettinger added the comment: Am still leaning towards rejecting this one based on: * paucity of use cases * non-atomicity (it can be built-out of existing tools) * minimizing the number of tools in the toolkit * not convinced that padded tuple unpacking is desirable

[issue5034] itertools.fixlen

2009-01-23 Thread Robert Lehmann
Robert Lehmann added the comment: When I started writing this patch this was actually what I intended. But having ``fixlen(range(3), 2)`` return 0 1 2 struck me as odd. Renaming the function to `pad` would help there indeed. It depends on which use case is more common: either fixing an iterator

[issue5034] itertools.fixlen

2009-01-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: Am taking this under advisement but am initially disinclined. It is not a basic itertool since it can be composed from the others. Also, it's use cases seem to be few. One challenge for the module is that adding more tools makes the overall toolkit harder

[issue5034] itertools.fixlen

2009-01-22 Thread Antoine Pitrou
Antoine Pitrou added the comment: "Return an iterator fixing *iterable*\ 's length to *length* by either cutting elements off or adding *value* to the iterable." Rather than mixing both, it would be more flexible to have a separate function for each IMO. Cutting off is already be handled by isl

[issue5034] itertools.fixlen

2009-01-22 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger nosy: +rhettinger versions: +Python 3.1 ___ Python tracker ___ ___ Python-bu

[issue5034] itertools.fixlen

2009-01-22 Thread Robert Lehmann
New submission from Robert Lehmann : As raised recently on python-ideas [1]_, an itertools method fixing iterators to a certain length might be handy (where fixing is either cutting elements off or appending values). I appended a patch implementing this feature in Python/C, unit tests and docume