"Error when calling the metaclass bases" when declaring class inside a module

Viewed 5654

Let me start by saying, I also get the same error whey defining __init__ and running super()'s __init__. I only simplified it down to this custom method to see if the error still happened.

import HTMLParser

class Spider(HTMLParser):
    """
    Just a subclass.
    """

This alone in a module raises the following error:

Traceback (most recent call last):
  File "D:\my\path\to\my\file
    class Spider(HTMLParser):
TypeError: Error when calling the metaclass bases
    module.__init__() takes at most 2 arguments (3 given)
1 Answers

And the answer is that I'm a complete noob. This is a module, not a class, but I'll leave this up here in case other noobs run into the same problem.

Solution:

from HTMLParser import HTMLParser

Each time I think I'm starting to become a pro, something like this happens :(

Related