Path: csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '16,': 0.03; 'from:addr:yahoo.co.uk': 0.04; 'reject': 0.07; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'language.': 0.14; 'awesome.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'roy': 0.16; 'subject:3.3': 0.16; 'subject:values': 0.16; 'subject:python': 0.16; ':-)': 0.16; 'language': 0.16; 'wrote:': 0.18; 'do.': 0.18; '>>>': 0.22; 'header:User-Agent:1': 0.23; 'library,': 0.24; 'compare': 0.26; 'values': 0.27; 'header:X-Complaints-To:1': 0.27; 'header:In- Reply-To:1': 0.27; 'rest': 0.29; '>>>>': 0.31; 'agreed.': 0.31; 'checking': 0.33; 'monday,': 0.33; 'december': 0.35; 'but': 0.35; 'there': 0.35; 'skip:[ 10': 0.38; 'to:addr:python-list': 0.38; 'anything': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'name': 0.63; 'our': 0.64; 'week,': 0.64; 'yes': 0.68; 'smith': 0.68; 'bag': 0.74; 'obvious': 0.74; 'day': 0.76; 'article': 0.77; 'rusi': 0.91; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: Comparing values of counter in python 3.3 Date: Mon, 16 Dec 2013 09:20:42 +0000 References: <7b7028b8-5de0-4a3a-a23b-2e19fe859955@googlegroups.com> <905d6e7e-6748-42dd-8b63-d80a4d175914@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-92-24-216-192.ppp.as43234.net User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 36 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1387185660 news.xs4all.nl 2905 [2001:888:2000:d::a6]:41662 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62026 On 16/12/2013 02:40, Roy Smith wrote: > In article <905d6e7e-6748-42dd-8b63-d80a4d175914@googlegroups.com>, > rusi wrote: > >> On Monday, December 16, 2013 7:29:31 AM UTC+5:30, alex23 wrote: >>>> # Need to compare values of counter and reject in function/routine in >>>> value in counter2 is higher then value in counter1 for a current key >> >>> [(k,Counter2[k]) for k in Counter2 - Counter1] >> >> Why not just? >> >> Counter2 - Counter1 >> >> And if you want to uncounterify it then >> dict(Counter2 - Counter1) >> >>> Counters are awesome. >> >> Yes -- agreed. But 'counter' is a strange name -- after checking whether >> 'bag' and 'multiset' are there in the library, I would not think to >> check anything else. > > Bag and multiset are names only CS weenies would think to look for. > Counter is the name for the rest of us :-) > Give me bag or multiset any day of the week, it's blatantly obvious what they do. Counter, what the heck? :) -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence