Python HTMLParser and super()
Posted on Thu 16 February 2012 in Posts • Tagged with python, inheritance
So I have a class that inherits from HTMLParser
, and I want to call the super class init (the __init__
of
HTMLParser
), I would think I should do:
class MyParser(HTMLParser):
def __init__(self):
super(MyParser, self).__init__()
But this causes a problem:
myparser = MyParser()
Traceback (most recent call last …
Continue reading