How to check if a variable is a tuple in Python?