Python Test If Variable Is Object