Initial Python distinct impl.