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
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
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
>>>
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
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