Message81736
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
wrong thing to do (unless those floats are integral), and that allowing
floating-point arguments invites misuse. For example, I'd be suspicious
of code that looked like:
for x in count(0.0, 0.1):
do_something_with_x
where it seems quite likely that what's intended is the more robust:
for i in count():
x = i/10.0
do_something_with_x
Second (unrelated) comment: on my machine, list(count()) appears to
hang, and is unresponsive to keyboard interrupts. Is there any easy way
to make this interruptible? While list(count()) is clearly a stupid
thing to type, it would be nice if it didn't hang the interpreter. |
|
Date |
User |
Action |
Args |
2009-02-12 10:57:50 | mark.dickinson | set | recipients:
+ mark.dickinson, rhettinger, LambertDW, steve21 |
2009-02-12 10:57:49 | mark.dickinson | set | messageid: <1234436269.66.0.0812186086859.issue5032@psf.upfronthosting.co.za> |
2009-02-12 10:57:48 | mark.dickinson | link | issue5032 messages |
2009-02-12 10:57:46 | mark.dickinson | create | |
|