[issue5032] itertools.count step

2009-02-12 Thread David W. Lambert
David W. Lambert added the comment: I run my shells with low priority so I can sneak around and kill them. ___ Python tracker ___ ___ Python-bu

[issue5032] itertools.count step

2009-02-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: More coolness: count(Fraction(2,3), Fraction(1,6)) ___ Python tracker ___ ___ Python-bugs-list mailing

[issue5032] itertools.count step

2009-02-12 Thread Mark Dickinson
Mark Dickinson added the comment: > to write: count(Decimal('1.1'), Decimal('.1')) and get exact > progressions. That's pretty cool. :-) > in itertools eons ago, there have been zero bug reports or user > complaints about the issue. So, I'll take it as a non-issue. Fair enough. _

[issue5032] itertools.count step

2009-02-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: Not too worried about either issue. For the first, it makes the code closer to its pure python equivalent. Better to add some math module function like Matlab's linspace(). It's hard to prevent people from creating numerical mistakes no matter what. Besid

[issue5032] itertools.count step

2009-02-12 Thread Mark Dickinson
Mark Dickinson added the comment: A couple of comments: > Also, improved the utility over its cousin, range() by allowing floating > point arguments. Is this wise? From a numerical perspective, it seems to me that using count with floating-point arguments is almost always going to be the wron

[issue5032] itertools.count step

2009-02-11 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: -> accepted status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue5032] itertools.count step

2009-02-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: Found a way to do this while keeping full speed on the default case. Also, fixed an error where the start argument was rounded to the nearest integer. Also, improved the utility over its cousin, range() by allowing floating point arguments. See r69522 ___

[issue5032] itertools.count step

2009-01-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: I've looked again at what it would take to update the C code and think that the optimizations there make it difficult to add this feature without adding a lot of code complexity and without slowing-down the common case. Also, I value the simplicity of the cu

[issue5032] itertools.count step

2009-01-26 Thread David W. Lambert
David W. Lambert added the comment: Probably a better prime factor algorithm uses Sieve of E. to generate primes through int(1+sqrt(n)) and test these. The other algorithm uses a custom generator anyway. Oh well, good luck, I'll shut up. You do have use cases that I couldn't think of. Dave.

[issue5032] itertools.count step

2009-01-26 Thread steve21
steve21 added the comment: I already use the second version of the count function you give (without default arguments which I am not a big fan of). I'm not saying its difficult or unreadable to bypass itertools.count and write your own enhanced count function. But if I use a custom count functio

[issue5032] itertools.count step

2009-01-26 Thread David W. Lambert
David W. Lambert added the comment: Nice. Now I know that $e$ is a least transcendental number. But I can't figure out why inserting this code into your file (and removing some "itertools.") is difficult or unreadable. I maintain a personal library of modules that I don't actually expect G

[issue5032] itertools.count step

2009-01-26 Thread steve21
steve21 added the comment: Here's a couple of functions I use with count and step: def cf_e(): '''return: (iterator) the infinite continued fraction for e e=[2; 1, 2, 1, 1, 4, 1, 1, 6, 1 , ... , 1, 2k, 1, ...] ''' yield 2 for k in itertools.count(2, 2): yield 1

[issue5032] itertools.count step

2009-01-22 Thread David W. Lambert
Changes by David W. Lambert : -- nosy: +LambertDW ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue5032] itertools.count step

2009-01-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: Am not too excited about this one. As a heavy itertools user myself, I've never had occasion to need a step argument. As an implementer, I'm aware that it would make the code for count() much more complex (because of the internal optimizations and because s

[issue5032] itertools.count step

2009-01-22 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger components: +Extension Modules -None nosy: +rhettinger priority: -> low versions: +Python 2.7, Python 3.1 -Python 3.0 ___ Python tracker __

[issue5032] itertools.count step

2009-01-22 Thread steve21
New submission from steve21 : I'd like to request a 'step' argument be added for itertools.count. It would be useful in the same way that step is useful for the 'range' function. ('range' and 'count' are very similar - 'count' could even be merged into 'range', for example by making 'range(None)