code: def icmp(a, b):
      "Like cmp(), but for any iterator."
      for xa in a:
          try:
              xb = next(b)
              d = cmp(xa, xb)
              if d: return d
          except StopIteration:
              return 1
      try:
          next(b)
          return -1
      except StopIteration:
          return f icmp(a, b):
      "Like cmp(), but for any iterator."
      for xa in a:
          try:
              xb = next(b)
              d = cmp(xa, xb)
              if d: return d
          except StopIteration:
              return 1
      try:
          next(b)
          return -1
      except StopIteration:
          return 0
docs: Like cmp(), but for any iterator.