use isinstance(X, Y) instead of 'type(X) is Y'
Merge pull request #4730 from hulu/isinstance-not-type-is

use isinstance(X, Y) instead of 'type(X) is Y'