diff dataset.py @ 314:105b54ac8260

bug fixed concerning the slicing, now ds[0:len(ds) + 1000 : 2] is accepted, same a python list
author Thierry Bertin-Mahieux <bertinmt@iro.umontreal.ca>
date Wed, 11 Jun 2008 13:57:34 -0400
parents 009ce84e9f52
children 5fe6d0c93109
line wrap: on
line diff
--- a/dataset.py	Wed Jun 11 13:53:39 2008 -0400
+++ b/dataset.py	Wed Jun 11 13:57:34 2008 -0400
@@ -481,6 +481,7 @@
         if type(i) is slice:
             offset = 0 if i.start is None else i.start
             upper_bound = len(self) if i.stop is None else i.stop
+            upper_bound = min(len(self) , upper_bound)
             i = list(range(offset, upper_bound, i.step))
 
         # handle tuples, arrays, lists