Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!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.020 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'subject:Question': 0.07; 'cc:addr:python-list': 0.10; 'def': 0.10; 'b):': 0.16; 'wrote:': 0.17; 'explicit': 0.22; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'probably': 0.29; 'fri,': 0.30; 'received:google.com': 0.34; 'received:209.85': 0.35; 'should': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'header:Received:5': 0.40; 'jul': 0.65 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=xzCCQFFrNjSOTESrP5uvtZu1OAzZSJn+vgZURXHJWk8=; b=TL8BGlsshapILFT0576OM6/a0m2Rj+DEtATiRpFP9beiADKHybpcoMf7gZWpoLeeO+ cMeyYkDKuIpGB0myFv7AVexYuQ0Fo5wRQI8ZxEYjyjtciJhXXkuze7yPmwO+5ni/Msq6 9yj10ZbvVwLNwGHLCIvtc+Jg1Acrz1dJGpCPwxZ45p8ZE8t2Cxb4dsxXKy4TzA8r42Ea FLXIzti557pZG1DSQxyJ+iBXB2T8h2hW3Llpu2HTyMCqLUzxAiWOHRSoHGtuWFgRFYn7 y19RGTiSVXor9Eqlt8vJC9bqFiZv6TOZuTQUsH+PKZrUnRy2AOuJNkllfOReNerx2epP eaHA== MIME-Version: 1.0 In-Reply-To: References: <87hatmr3xf.fsf@handshake.de> <87a9ze85h2.fsf@handshake.de> From: Ian Kelly Date: Fri, 6 Jul 2012 11:51:32 -0600 Subject: Re: Question about weakref To: Frank Millman Content-Type: text/plain; charset=ISO-8859-1 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1341597125 news.xs4all.nl 6989 [2001:888:2000:d::a6]:42881 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:24981 On Fri, Jul 6, 2012 at 11:48 AM, Ian Kelly wrote: > def del_b(self, b): > for i, x in enumerate(self.array): > if b is x: > del self.array[i] That should probably have an explicit break on the end: def del_b(self, b): for i, x in enumerate(self.array): if b is x: del self.array[i] break