def _GivePropertiesFromGeneralToSpecific(handler_list):
 for (i, j) in itertools.combinations(xrange(len(handler_list)), 2):
  if handler_list[j].MatchesAll(handler_list[i]):
   if isinstance(handler_list[i], SimpleHandler):
    handler_list[i] = handler_list[i].CreateOverlappedHandler()
   handler_list[i].AddMatchingHandler(handler_list[j])

def _GivePropertiesFromGeneralToSpecific ( handler_list ) : for ( i , j ) in itertools . combinations ( xrange ( len ( handler_list ) ) , 2 ) : if handler_list [ j ] . MatchesAll ( handler_list [ i ] ) : if isinstance ( handler_list [ i ] , SimpleHandler ) : handler_list [ i ] = handler_list [ i ] . CreateOverlappedHandler ( ) handler_list [ i ] . AddMatchingHandler ( handler_list [ j ] )
makes sure that handlers have all properties of more general ones .