Avoid issubclass calls taking 20% of runtime

Set lookup is 200x faster.