On Monday, December 31, 2012 12:18:48 PM UTC+8, contro opinion wrote:
> here is my haha class
> class haha(object):
> def theprint(self):
> print "i am here"
>
The definition of a class named haha.
> >>> haha().theprint()
> i am here
> >>> haha(object).theprint()
> Traceback (most recen
On Mon, 31 Dec 2012 20:23:44 +1100, Ben Finney wrote:
> Chris Rebert writes:
>
>> By contrast, in the first part of the *expression*
>> `haha(object).theprint()`, you passed an argument (namely, `object`).
>> Since __init__() wasn't expecting any arguments whatsoever, you
>> therefore got an err
On Mon, Dec 31, 2012 at 1:23 AM, Ben Finney wrote:
> Chris Rebert writes:
>
>> By contrast, in the first part of the *expression*
>> `haha(object).theprint()`, you passed an argument (namely, `object`).
>> Since __init__() wasn't expecting any arguments whatsoever, you
>> therefore got an error.
Chris Rebert writes:
> By contrast, in the first part of the *expression*
> `haha(object).theprint()`, you passed an argument (namely, `object`).
> Since __init__() wasn't expecting any arguments whatsoever, you
> therefore got an error.
Why is everyone talking about the initialiser, ‘__init__’?
On Sun, Dec 30, 2012 at 8:18 PM, contro opinion wrote:
> here is my haha class
> class haha(object):
> def theprint(self):
> print "i am here"
>
haha().theprint()
> i am here
haha(object).theprint()
> Traceback (most recent call last):
> File "", line 1, in
> TypeError: objec
On 2012.12.30 22:18, contro opinion wrote:
> here is my haha class
> class haha(object):
> def theprint(self):
> print "i am here"
>
haha().theprint()
> i am here
haha(object).theprint()
> Traceback (most recent call last):
> File "", line 1, in
> TypeError: object.__new__()
In article ,
contro opinion wrote:
> here is my haha class
> class haha(object):
> def theprint(self):
> print "i am here"
>
> >>> haha().theprint()
> i am here
> >>> haha(object).theprint()
> Traceback (most recent call last):
> File "", line 1, in
> TypeError: object.__new__() tak
here is my haha class
class haha(object):
def theprint(self):
print "i am here"
>>> haha().theprint()
i am here
>>> haha(object).theprint()
Traceback (most recent call last):
File "", line 1, in
TypeError: object.__new__() takes no parameters
why haha(object).theprint() get wrong o