modify __cmp__ to __eq__