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)
Pychecker and Pylint are the static analysis tools that help to find bugs in python. Pychecker is an opensource tool for static analysis that detects the bugs from source code and warns about the style and complexity of the bug.
The most common reason of an error in a Python program is when a certain statement is not in accordance with the prescribed usage. Such an error is called a syntax error. The Python interpreter immediately reports it, usually along with the reason. >>> print "hello" SyntaxError: Missing parentheses in call to 'print'.
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 :(
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With