[Python-ideas] Possible new itertool: comm()

Victor Stinner victor.stinner at gmail.com
Wed Jan 7 15:19:31 CET 2015


2015-01-06 18:14 GMT+01:00 Raymond Hettinger <raymond.hettinger at gmail.com>:
>> 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.

I never used the UNIX comm tool. I didn't know that it exists :-)

Can you maybe explain the purpose the tool/your function? Show an example.

difflib may be a better candidate to add such function than contextlib.


More information about the Python-ideas mailing list