def infer_subscript(self, context=None):
 value = next(self.value.infer(context))
 if (value is YES):
  (yield YES)
  return
 index = next(self.slice.infer(context))
 if (index is YES):
  (yield YES)
  return
 if isinstance(index, nodes.Const):
  try:
   assigned = value.getitem(index.value, context)
  except AttributeError:
   raise InferenceError()
  except (IndexError, TypeError):
   (yield YES)
   return
  if (self is assigned):
   (yield YES)
   return
  for infered in assigned.infer(context):
   (yield infered)
 else:
  raise InferenceError()

def infer_subscript ( self , context = None ) : value = next ( self . value . infer ( context ) ) if ( value is YES ) : ( yield YES ) return index = next ( self . slice . infer ( context ) ) if ( index is YES ) : ( yield YES ) return if isinstance ( index , nodes . Const ) : try : assigned = value . getitem ( index . value , context ) except AttributeError : raise InferenceError ( ) except ( IndexError , TypeError ) : ( yield YES ) return if ( self is assigned ) : ( yield YES ) return for infered in assigned . infer ( context ) : ( yield infered ) else : raise InferenceError ( )
infer simple subscription such as [1 .