write _equals_bytes for python3