python: Implement Message.__cmp__ and __hash__