Fix rich comparisons for scalars for Python3