On 22 August 2011 00:17, Dave Angel <d...@davea.name> wrote: > On 08/21/2011 05:35 PM, D. Guandalino wrote: > >> Python documentation says: >> >> exception TypeError >>> >>> Raised when an operation or function is applied to an object of >>> inappropriate type. The associated value is a string giving details >>> about the type mismatch. >>> >> >>
> You didn't supply a parameter in the __init__() to receive the value of 1. > The self argument is automatically supplied by Python for all ordinary > method calls including initial object construction. So when you say C(1) > you're actually going to get 2 arguments in the __init__() call. > > Add another parm to the definition: > > def __init__(self, startvalue): > pass > Thanks and apologies for not being clear. I missed to say that I'm more interested in understanding which error I did with types (given that a TypeError is raised) than in fixing the code.
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor