Should this use isinstance or type?