[Python-ideas] Counter comparison

Serhiy Storchaka storchaka at gmail.com
Sat Nov 22 19:03:02 CET 2014


On 22.11.14 01:55, Antony Lee wrote:
> As Counter objects effectively behave like multi-sets, it seems
> reasonable to overload <, <=, >, >= as for set objects to check whether
> a Counter is a sub/super-set of another Counter:
>
> c < d  <===>  all(c[k] < d[k] for k in c)
>
> Thoughts?

http://bugs.python.org/issue22515




More information about the Python-ideas mailing list