Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'if,': 0.09; 'message-id:@stoneleaf.us': 0.09; 'methods,': 0.09; 'solution,': 0.09; '~ethan~': 0.09; 'dict': 0.16; 'overridden': 0.16; 'subject: \n ': 0.16; 'subject:class': 0.16; 'subject:failed': 0.16; 'subject:key': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'subject:like': 0.24; 'looks': 0.24; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'subject:that': 0.31; 'but': 0.35; 'method': 0.36; 'charset:us-ascii': 0.36; 'example,': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:173': 0.61; 'first': 0.61; 'provide': 0.64; 'received:69.56': 0.68; 'study': 0.69 Date: Mon, 30 Jun 2014 08:34:48 -0700 From: Ethan Furman User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Creating a dict-like class that counts successful and failed key matches References: <1404135829.10485.136092537.2F0486D2@webmail.messagingengine.com> <1404139465.27658.136120269.0CA38211@webmail.messagingengine.com> In-Reply-To: <1404139465.27658.136120269.0CA38211@webmail.messagingengine.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3304.hostgator.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stoneleaf.us X-BWhitelist: no X-Source-IP: 173.12.184.233 X-Exim-ID: 1X1dbU-00051r-0d X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([173.12.184.233]) [173.12.184.233]:36273 X-Source-Auth: ethan+stoneleaf.us X-Email-Count: 1 X-Source-Cap: dG9idWs7dG9idWs7Z2F0b3IzMzA0Lmhvc3RnYXRvci5jb20= 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: 12 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1404145915 news.xs4all.nl 2832 [2001:888:2000:d::a6]:55446 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:73751 On 06/30/2014 07:44 AM, python@bdurham.com wrote: > > Nice!!! > > I need to study your solution, but at first blush it looks exactly like > what I wanted to implement. Keep in mind that dict /will not/ call your overridden methods, so if, for example, you provide your own __getitem__ you will also need to provide your own copies of any dict method that calls __getitem__. -- ~Ethan~