Exemplo n.º 1
0
 def __call__(self, state, scope, paramTypes, a, *where):
     if len(where) == 2:
         start, end = where
         normStart, normEnd = startEnd(len(a), start, end)
         before = a[:normStart]
         after = a[normEnd:]
         return before + after
     elif len(where) == 1:
         index, = where
         normIndex = negativeIndex(len(a), index)
         checkRange(len(a), normIndex)
         before = a[:normIndex]
         after = a[(normIndex + 1):]
         return before + after
Exemplo n.º 2
0
 def __call__(self, state, scope, paramTypes, a, index, item):
     normIndex = negativeIndex(len(a), index)
     checkRange(len(a), normIndex)
     before = a[:normIndex]
     after = a[(normIndex + 1):]
     return before + [item] + after