[Tutor] problem with a sub-class

Shall, Sydney sydney.shall at kcl.ac.uk
Thu Nov 30 10:37:42 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

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.


Professor Sydney Shall
Department of Haematology/Oncology
Phone: +(0)2078489200
E-Mail: sydney.shall
[Correspondents outside the College should add @kcl.ac.uk]

More information about the Tutor mailing list