What's the difference between type() and isinstance() methods, and which one is better for checking the type of an object?