Variations on imap (iteratable mapping in Python)