def _resolve_looppart(parts, asspath, context):
 asspath = asspath[:]
 index = asspath.pop(0)
 for part in parts:
  if (part is YES):
   continue
  if (not hasattr(part, 'itered')):
   continue
  try:
   itered = part.itered()
  except TypeError:
   continue
  for stmt in itered:
   try:
    assigned = stmt.getitem(index, context)
   except (AttributeError, IndexError):
    continue
   except TypeError:
    continue
   if (not asspath):
    (yield assigned)
   elif (assigned is YES):
    break
   else:
    try:
     for infered in _resolve_looppart(assigned.infer(context), asspath, context):
      (yield infered)
    except InferenceError:
     break

def _resolve_looppart ( parts , asspath , context ) : asspath = asspath [ : ] index = asspath . pop ( 0 ) for part in parts : if ( part is YES ) : continue if ( not hasattr ( part , 'itered' ) ) : continue try : itered = part . itered ( ) except TypeError : continue for stmt in itered : try : assigned = stmt . getitem ( index , context ) except ( AttributeError , IndexError ) : continue except TypeError : continue if ( not asspath ) : ( yield assigned ) elif ( assigned is YES ) : break else : try : for infered in _resolve_looppart ( assigned . infer ( context ) , asspath , context ) : ( yield infered ) except InferenceError : break
recursive function to resolve multiple assignments on loops .