parameters: (self, which)
return_statement: return v
docstring: >>> obj = LazySig(lambda x:x,10)
       >>> obj[1]
       1
       >>> obj[-1]
       9
       >>> try:
       ...   obj[10]
       ... except IndexError:
       ...   1
       ... else:
       ...   0
       1
       >>> try:
       ...   obj[-10]
       ... except IndexError:
       ...   1
       ... else:
       ...   0
       1
function: def __getitem__(self, which):
      """
  
       >>> obj = LazySig(lambda x:x,10)
       >>> obj[1]
       1
       >>> obj[-1]
       9
       >>> try:
       ...   obj[10]
       ... except IndexError:
       ...   1
       ... else:
       ...   0
       1
       >>> try:
       ...   obj[-10]
       ... except IndexError:
       ...   1
       ... else:
       ...   0
       1
  
      """
      if which < 0:
        # handle negative indices
        which = self.size + which
  
      if which <= 0 or which >= self.size:
        raise IndexError('bad index')
  
      if which in self._cache:
        v = self._cache[which]
      else:
        v = self.computeFunc(which)
        self._cache[which] = v
      return v
function_tokens: def __getitem__ ( self , which ) : if which < 0 : # handle negative indices which = self . size + which if which <= 0 or which >= self . size : raise IndexError ( 'bad index' ) if which in self . _cache : v = self . _cache [ which ] else : v = self . computeFunc ( which ) self . _cache [ which ] = v return v