TypeError: module() takes at most 2 arguments (3 given) code example

Example 1: python class typeerror module() takes at most 2 arguments (3 given)

this error is often due to the fact that the classes are at the same time modules

example: 
let's create a file A.py (module) containing a class A and the same for B.
If B extend from A then to import class A into B we do:
from A_module import A_className


in our example:

the python code will be:
import A from A
class B(A):
	....

Example 2: TypeError: takes 0 positional arguments but 1 was given python

When Python tells you "generatecode() takes 0 positional arguments but 1 was
given", it's telling you that your method is set up to take no arguments, but
the self argument is still being passed when the method is called, so in fact
it is receiving one argument.

Adding self to your method definition should resolve the problem.