Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #24981

Re: Question about weakref

References (2 earlier) <jt3tc0$5q6$1@dough.gmane.org> <87a9ze85h2.fsf@handshake.de> <jt62f2$t89$1@dough.gmane.org> <CALwzidmAZavM-R1UXE_Qb-6vmk-518fZ-vJGd2GEHbTROAn2Vg@mail.gmail.com> <CALwzidksHx35Rte=StR-MyTjv79XseK2E+K4H0V5DYxo86W5pQ@mail.gmail.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date 2012-07-06 11:51 -0600
Subject Re: Question about weakref
Newsgroups comp.lang.python
Message-ID <mailman.1867.1341597125.4697.python-list@python.org> (permalink)

Show all headers | View raw


On Fri, Jul 6, 2012 at 11:48 AM, Ian Kelly <ian.g.kelly@gmail.com> 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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Question about weakref Ian Kelly <ian.g.kelly@gmail.com> - 2012-07-06 11:51 -0600

csiph-web