Re: father class name

2013-01-01 Thread 88888 Dihedral
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

Re: father class name

2012-12-31 Thread Steven D'Aprano
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

Re: father class name

2012-12-31 Thread Chris Rebert
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.

Re: father class name

2012-12-31 Thread Ben Finney
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__’?

Re: father class name

2012-12-30 Thread Chris Rebert
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

Re: father class name

2012-12-30 Thread Andrew Berg
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__()

Re: father class name

2012-12-30 Thread Roy Smith
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

father class name

2012-12-30 Thread contro opinion
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