Message104681
Currently, in trunk, I get:
>>> range(0.0, 11.0, 1.1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: range() integer start argument expected, got float.
But with Alexander's patch on trunk, I get:
>>> range(0.0, 11.0, 1.1)
[0L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L]
I'm not sure whether this is intentional or not, but IIRC it was a very deliberate choice not to allow float arguments to range (especially when, as here, the arguments are simply being truncated). I don't think this is an acceptable change for 2.7 (still less for 2.6).
Any patch for this issue should not change the behaviour for small arguments.
IMO, the *right* solution is to convert arguments via __index__ when possible (as 3.x appears to already do). However, this would be a new feature. I suggest closing this as a 'won't fix'. |
|
Date |
User |
Action |
Args |
2010-05-01 00:53:40 | mark.dickinson | set | recipients:
+ mark.dickinson, loewis, rhettinger, belopolsky, christian.heimes, josm, robertwb, zanella, akitada |
2010-05-01 00:53:40 | mark.dickinson | set | messageid: <1272675220.66.0.964758512902.issue1533@psf.upfronthosting.co.za> |
2010-05-01 00:53:38 | mark.dickinson | link | issue1533 messages |
2010-05-01 00:53:36 | mark.dickinson | create | |
|