[Python-ideas] Possible new itertool: comm()
p.f.moore at gmail.com
Tue Jan 6 19:22:44 CET 2015
On 6 January 2015 at 17:14, Raymond Hettinger
<raymond.hettinger at gmail.com> wrote:
>> On Jan 6, 2015, at 8:22 AM, Paul Moore <p.f.moore at gmail.com> wrote:
>> In writing a utility script today, I found myself needing to do
>> something similar to what the Unix "comm" utility does - take two
>> sorted iterators, and partition the values into "only in the first",
>> "only in the second", and "in both" groups.
> As far as I can tell, this would be a very rare need.
It's come up for me a few times, usually when trying to check two
lists of files to see which ones have been missed by a program, and
which ones the program thinks are present but no longer exist. Its use
cases are about as common as those of the Unix "comm" tool :-)
But I take your point, it's not *that* common.
More information about the Python-ideas