py: Add dispatch for user defined ==, >, <=, >=.

Addresses issue #827.