A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2015-September/141491.html below:

[Python-Dev] Comparison operators (> < >= <=) for collections.Counter

[Python-Dev] Comparison operators (> < >= <=) for collections.Counter [Python-Dev] Comparison operators (> < >= <=) for collections.CounterSerhiy Storchaka storchaka at gmail.com
Tue Sep 8 04:58:55 CEST 2015
On 08.09.15 05:06, Kerrick Staley wrote:
> I noticed that collections.Counter, unlike set, doesn't support the
> ordered comparison operators (> < >= <=). I'd like to propose
> implementing these operators in an analogous fashion to set: counter1 >=
> counter2 if counter1 contains at least as many of every key as counter2
> does. Cases where counter1 doesn't have a key and counter2 has a
> negative amount of that key would still count as >=. counter1 > counter2
> when counter1 >= counter2 and counter1 != counter2.
>
> Does this sound reasonable? If so I'll write up and submit a patch.

This idea already was rejected. http://bugs.python.org/issue22515


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4