Use isinstance() to check type of object