def matches_subject_class(self, subject):
for sub in self.subjects:<EOL><INDENT>if inspect.isclass(sub):<EOL><INDENT>if inspect.isclass(subject):<EOL><INDENT>return issubclass(subject, sub)<EOL><DEDENT>else:<EOL><INDENT>return isinstance(subject, sub)<EOL><DEDENT><DEDENT>elif isinstance(sub, string_types):<EOL><INDENT>if inspect.isclass(subject):<EOL><INDENT>return subject.__name__ == sub<EOL><DEDENT>else:<EOL><INDENT>return subject.__class__.__name__ == sub<EOL><DEDENT><DEDENT><DEDENT>return False<EOL>
subject can be either Classes or instances of classes
self.subjects can either be string or Classes