t203.py 678 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. class Stuff(object):
  2. def __cmp__(self, rhs):
  3. print "stuff cmp"
  4. return 0
  5. class Things(object):
  6. def __cmp__(self, rhs):
  7. print "things cmp"
  8. return 0
  9. class Other(object): pass
  10. Stuff() < Things()
  11. Stuff() <= Things()
  12. Stuff() > Things()
  13. Stuff() >= Things()
  14. Stuff() == Things()
  15. Stuff() != Things()
  16. Things() < Stuff()
  17. Things() <= Stuff()
  18. Things() > Stuff()
  19. Things() >= Stuff()
  20. Things() == Stuff()
  21. Things() != Stuff()
  22. Stuff() < Other()
  23. Stuff() <= Other()
  24. Stuff() > Other()
  25. Stuff() >= Other()
  26. Stuff() == Other()
  27. Stuff() != Other()
  28. Other() < Stuff()
  29. Other() <= Stuff()
  30. Other() > Stuff()
  31. Other() >= Stuff()
  32. Other() == Stuff()
  33. Other() != Stuff()