comparison cmd2.py @ 306:1802f8c75265

new History.span()
author catherine@dellzilla
date Wed, 27 Jan 2010 16:29:33 -0500
parents f84e8be8a792
children 43273a4b517c
comparison
equal deleted inserted replaced
305:f84e8be8a792 306:1802f8c75265
1124 >>> h.span('2..') 1124 >>> h.span('2..')
1125 ['second', 'third', 'fourth'] 1125 ['second', 'third', 'fourth']
1126 >>> h.span('-1') 1126 >>> h.span('-1')
1127 ['fourth'] 1127 ['fourth']
1128 >>> h.span('-2..-3') 1128 >>> h.span('-2..-3')
1129 ['third', 'second'] 1129 ['third', 'second']
1130 ''' 1130 '''
1131 def zero_based_index(self, onebased): 1131 def zero_based_index(self, onebased):
1132 result = onebased 1132 result = onebased
1133 if result > 0: 1133 if result > 0:
1134 result -= 1 1134 result -= 1