fix equality funtion for python3 support