Message15511
Logged In: YES
user_id=760126
'slice' doesn't round its arguments. The difference
is whether you pass an integer or a float as part
of the slice. Thus:
a[:7] gives a key of slice(0,7,None)
while
a[:7.0] gives a key of slice(None,7.0,None)
What's going on I suspect is that the python
has two different behaviours for __getitem__.
The first handles slices with integer only
components, and defaults to starting at zero.
The second handles anything else. This is
probably done in order to accomodate old
'list' and 'tuple' implementation code that doesn't
accept starting indices of None. But the best
solution would be to eliminate the dual behavior
of slice and revise the list and tuple code to
accept the more general behavior.
|
|
Date |
User |
Action |
Args |
2007-08-23 14:12:32 | admin | link | issue723806 messages |
2007-08-23 14:12:32 | admin | create | |
|