Negative slicing gives unexpected result
Bug #421829 reported by
Jeroen T. Vermeulen
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Storm |
New
|
Undecided
|
Unassigned |
Bug Description
This may be related to bug 239767: results[-1:] gives me all of results, but list(results)[-1:] gives me just the last row as I would expect.
It's been pointed out to me that I can use last(), but the -1 is just the test case I hit this with; it's actually a variable in my code.
I've worked around this by reversing the sort order myself and using the absolute value of the slice value. It's ugly though, as the change spans a module boundary.
To post a comment you must log in.
I just filed bug 421829, but it may be a duplicate of this one. Leaving that for the Storm engineers to decide.