Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class A(object):
- def __lt__(self, rhs):
- print 'A.lt'
- return NotImplemented
- def __gt__(self, rhs):
- print 'A.gt'
- return NotImplemented
- def __cmp__(self, rhs):
- print 'A.cmp'
- return NotImplemented
- class B(object):
- def __lt__(self, rhs):
- print 'B.lt'
- return NotImplemented
- def __gt__(self, rhs):
- print 'B.gt'
- return NotImplemented
- def __cmp__(self, rhs):
- print 'B.cmp'
- return NotImplemented
- a, b = A(), B()
- print a < b
- print cmp(a, b)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement