HTML Parser - beginner needs help

Alex Martelli aleaxit at
Fri Sep 15 22:40:13 CEST 2000

"zet" <zet at> wrote in message
news:969039005.872906 at
> Thanx a lot guys.
> I've tried another way and it work (but it has one big minus).
> I change in this way:
>     def handle_image(self, src, alt, *args):
>         self.handle_data(alt)
>         self.imagelist.append(src)  # this line was added, and imegelist =
> [] in __init__
> Somewhat stupid, how do you think?

I think you've fallen straight into a typical anti-pattern: modifying
a component just because you have source.  You'll pay for the
mistake many times over, even if it's a small mod, like here.

Inherit from the class, override its method, and you have no
need for such changes, while achieving the same effect. *MUCH*


More information about the Python-list mailing list