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 recent call last):

Re: father class name

2012-12-31 Thread Ben Finney
Chris Rebert c...@rebertia.com 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

Re: father class name

2012-12-31 Thread Chris Rebert
On Mon, Dec 31, 2012 at 1:23 AM, Ben Finney ben+pyt...@benfinney.id.au wrote: Chris Rebert c...@rebertia.com 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

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 c...@rebertia.com 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

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 stdin, line 1, in module TypeError: object.__new__() takes no parameters why haha(object).theprint() get wrong

Re: father class name

2012-12-30 Thread Roy Smith
In article mailman.1483.1356927535.29569.python-l...@python.org, contro opinion contropin...@gmail.com 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):

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 stdin, line 1, in module TypeError: object.__new__() takes no

Re: father class name

2012-12-30 Thread Chris Rebert
On Sun, Dec 30, 2012 at 8:18 PM, contro opinion contropin...@gmail.com 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 stdin, line 1, in module