Re: [Tutor] Please explain TypeError

2011-08-21 Thread Steven D'Aprano
D. Guandalino wrote: class C(object): ... def __init__(self): ... pass ... C(1) Traceback (most recent call last): File "", line 1, in TypeError: __init__() takes exactly 1 argument (2 given) I'm having hard times understanding why a TypeError is raised here. Could you exp

Re: [Tutor] Please explain TypeError

2011-08-21 Thread Walter Prins
On 21 August 2011 22:35, D. Guandalino wrote: > >>> class C(object): > ... def __init__(self): > ... pass > ... > >>> C(1) > Traceback (most recent call last): > File "", line 1, in > TypeError: __init__() takes exactly 1 argument (2 given) > > I'm having hard times understandin

Re: [Tutor] Please explain TypeError

2011-08-21 Thread D. Guandalino
On 22 August 2011 00:17, Dave Angel 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 >>>

Re: [Tutor] Please explain TypeError

2011-08-21 Thread Dave Angel
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. For example: 'foo' + (1, 2) Traceback (mo

[Tutor] Please explain TypeError

2011-08-21 Thread D. Guandalino
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. For example: >>> 'foo' + (1, 2) Traceback (most recent call last): File "", line