Question about weakref

Ian Kelly ian.g.kelly at gmail.com
Fri Jul 6 19:51:32 CEST 2012


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



More information about the Python-list mailing list