[Tutor] problem with sub-classing

Sydney282003 Sydney282003 at yahoo.com
Thu Nov 30 12:51:07 EST 2017

I am almost a beginner.
I have an error message which I cannot understand.
My problem is with constructing a sub-class.

I use;
MAC OS V10.13.1
Anaconda Python 3.5

My base Class works properly and all 136 tests of the Base Class are 

My sub-class is constructed as follows:

import sys
import random
import numpy as np
import pylab
import copy
import Population_InitV8 as POCI
import Population_ProductivityV24 as POCWP

My program starts thus:

line 27 : class SimulateCycleZero(POCWP):
line 28 :     def __init__(self, dirname_p):

The program follows on from this.

The error message is as follows:

line 27, in <module>
     class SimulateCycleZero(POCWP):

TypeError: module.__init__() takes at most 2 arguments (3 given)

My problem is that I do not understand to which file the word 'module' 
in the error message applies.

It seems to me that somewhere I am providing 3 arguments when only a 
maximum of two are required.

When I do the following, I get the same error message.

line 27 : class SimulateCycleZero(POCWP):
line 28 :     def __init__(self):

I would appreciate some guidance , please.



More information about the Tutor mailing list