use isinstance(obj, typ) instead of type(obj) == typ

it supports inheritance

Change-Id: I935c78736e9bfa995a62a88cc4c9a0c581ba0f60
Merge "use isinstance(obj, typ) instead of type(obj) == typ"