py: Fix bug where == and != not handled for small_ints.