How can I compare the type of 2 variables in a python method? The instruction "if type(var1) == type(var2): ...." doesn't work.