On Wed, 02 Sep 2009 16:41:34 -0700, Bob van der Poel wrote: > But, translating 1, 2 or 3 ints into a valid splice isn't quit that > easy? I could figure each value, and convert them to either int or None > (key is the None! From my previous try '' doesn't work!) > > But, I still need three possible lines: > > if len(i) == 1: > x=x[i(0)] > else if len(i) == 2: > x=x[i(0):i(1)] > ....
items = [int(n) for n in slice_string.split(":")] slice(*items) -- Steven -- http://mail.python.org/mailman/listinfo/python-list