def _is_best_match(class1, class2, format_classes):
 return ((class1 is class2) or (issubclass(class1, class2) and (class1 not in {cls for (fmt, cls) in format_classes})))

def _is_best_match ( class1 , class2 , format_classes ) : return ( ( class1 is class2 ) or ( issubclass ( class1 , class2 ) and ( class1 not in { cls for ( fmt , cls ) in format_classes } ) ) )
determine if class2 is the "best" match for class1 in the list of classes .