Re: the class problem

2013-01-01 Thread Tim Roberts
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__() takes no parameters > >why

Re: class problem

2012-12-30 Thread Chris Rebert
On Sun, Dec 30, 2012 at 10:36 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: obje

Re: class problem

2012-12-30 Thread Dave Angel
On 12/31/2012 01:36 AM, contro opinion wrote: > here is my haha class You posted the same question twice before, and it was answered two hours ago. Read the first thread, instead of starting spurious ones. -- DaveA -- http://mail.python.org/mailman/listinfo/python-list

Re: class problem, NoneType obj has no attribute

2008-05-16 Thread J. Cliff Dyer
On Fri, 2008-05-16 at 06:04 -0700, globalrev wrote: > On 16 Maj, 13:54, Peter Otten <[EMAIL PROTECTED]> wrote: > > Christian Heimes wrote: > > > globalrev schrieb: > > >> cust1 = customer.__init__('12',['1','435','2332']) > > > > > cust1 = customer('12',['1','435','2332']) > > > > ... and before th

Re: class problem, NoneType obj has no attribute

2008-05-16 Thread Bruno Desthuilliers
globalrev a écrit : On 16 Maj, 14:19, Bruno Desthuilliers wrote: globalrev a écrit : (snip) def getMovies(): return self.movies 4/ Python has support for computed attributes, so you just don't need these getters. > when class = > class customer: Please, do yourself and the wor

Re: class problem, NoneType obj has no attribute

2008-05-16 Thread Larry Bates
globalrev wrote: On 16 Maj, 14:19, Bruno Desthuilliers wrote: globalrev a écrit : wassup here? 7 Traceback (most recent call last): File "C:\Python25\myPrograms\netflix\netflix.py", line 22, in print cust1.getID() AttributeError: 'NoneType' object has no attribute 'getID' class custome

Re: class problem, NoneType obj has no attribute

2008-05-16 Thread Bruno Desthuilliers
globalrev a écrit : On 16 Maj, 14:19, Bruno Desthuilliers wrote: globalrev a écrit : (snip) cust1 = customer.__init__('12',['1','435','2332']) __init__ is automagically called on instanciation, so you don't have to call it yourself. And FWIW, your __init__ returns None. what should init re

Re: class problem, NoneType obj has no attribute

2008-05-16 Thread J. Cliff Dyer
On Fri, 2008-05-16 at 06:07 -0700, globalrev wrote: > On 16 Maj, 14:19, Bruno Desthuilliers [EMAIL PROTECTED]> wrote: > > globalrev a écrit : > > > > > wassup here? > > > > > 7 > > > > > Traceback (most recent call last): > > > File "C:\Python25\myPrograms\netflix\netflix.py", line 22, in > > >

Re: class problem, NoneType obj has no attribute

2008-05-16 Thread Peter Otten
globalrev wrote: > On 16 Maj, 13:54, Peter Otten <[EMAIL PROTECTED]> wrote: >> Christian Heimes wrote: >> > globalrev schrieb: >> >> cust1 = customer.__init__('12',['1','435','2332']) >> >> > cust1 = customer('12',['1','435','2332']) >> >> ... and before that >> >> from customer import customer >>

Re: class problem, NoneType obj has no attribute

2008-05-16 Thread globalrev
On 16 Maj, 14:19, Bruno Desthuilliers wrote: > globalrev a écrit : > > > wassup here? > > > 7 > > > Traceback (most recent call last): > > File "C:\Python25\myPrograms\netflix\netflix.py", line 22, in > > > > print cust1.getID() > > AttributeError: 'NoneType' object has no attribute 'getID'

Re: class problem, NoneType obj has no attribute

2008-05-16 Thread globalrev
On 16 Maj, 14:19, Bruno Desthuilliers wrote: > globalrev a écrit : > > > wassup here? > > > 7 > > > Traceback (most recent call last): > > File "C:\Python25\myPrograms\netflix\netflix.py", line 22, in > > > > print cust1.getID() > > AttributeError: 'NoneType' object has no attribute 'getID'

Re: class problem, NoneType obj has no attribute

2008-05-16 Thread globalrev
On 16 Maj, 13:54, Peter Otten <[EMAIL PROTECTED]> wrote: > Christian Heimes wrote: > > globalrev schrieb: > >> cust1 = customer.__init__('12',['1','435','2332']) > > > cust1 = customer('12',['1','435','2332']) > > ... and before that > > from customer import customer > > Peter why do i have to wri

Re: class problem, NoneType obj has no attribute

2008-05-16 Thread Bruno Desthuilliers
globalrev a écrit : wassup here? 7 Traceback (most recent call last): File "C:\Python25\myPrograms\netflix\netflix.py", line 22, in print cust1.getID() AttributeError: 'NoneType' object has no attribute 'getID' class customer: 1/ naming convention : class names should be CamelCased

Re: class problem, NoneType obj has no attribute

2008-05-16 Thread Peter Otten
Christian Heimes wrote: > globalrev schrieb: >> cust1 = customer.__init__('12',['1','435','2332']) > > cust1 = customer('12',['1','435','2332']) ... and before that from customer import customer Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: class problem, NoneType obj has no attribute

2008-05-16 Thread Christian Heimes
globalrev schrieb: > cust1 = customer.__init__('12',['1','435','2332']) cust1 = customer('12',['1','435','2332']) Christian -- http://mail.python.org/mailman/listinfo/python-list

class problem, NoneType obj has no attribute

2008-05-16 Thread globalrev
wassup here? >>> 7 Traceback (most recent call last): File "C:\Python25\myPrograms\netflix\netflix.py", line 22, in print cust1.getID() AttributeError: 'NoneType' object has no attribute 'getID' >>> class customer: def __init__(self, ID, movies): self.ID = ID self.m

Re: class problem

2006-08-28 Thread Jorge Vargas
On 8/28/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Jorge Vargas wrote: > > > seems like a feature/bug of 2.5, why your learning a language with a > > beta version? > > learning? I'm sorry I though you where the original poster. > > (btw, the "c" in 2.5c1 means *release candidate*, not "beta").

Re: class problem

2006-08-28 Thread Fredrik Lundh
Jorge Vargas wrote: > seems like a feature/bug of 2.5, why your learning a language with a > beta version? learning? (btw, the "c" in 2.5c1 means *release candidate*, not "beta"). -- http://mail.python.org/mailman/listinfo/python-list

Re: class problem

2006-08-28 Thread Jorge Vargas
On 8/28/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Duncan Booth wrote: > > > Yes, the first one is a syntax error because you aren't allowed empty > > parentheses in a class statement > > however, > > $ python > Python 2.5c1 /.../ > >>> class foo(): > ... pass > ... > >>> foo > > >>> >

Re: class problem

2006-08-28 Thread Bruno Desthuilliers
fegge a écrit : > when i declare a class, is there difference between the below: > class myClass(): > class myClass(threading.Thread) > If you don't know the answer to this, then it's time to read the fine manual. Please come back when done. -- http://mail.python.org/mailman/listinfo/python-list

Re: class problem

2006-08-28 Thread Fredrik Lundh
Duncan Booth wrote: > Yes, the first one is a syntax error because you aren't allowed empty > parentheses in a class statement however, $ python Python 2.5c1 /.../ >>> class foo(): ... pass ... >>> foo >>> -- http://mail.python.org/mailman/listinfo/python-list

Re: class problem

2006-08-28 Thread Fredrik Lundh
fegge wrote: > when i declare a class, is there difference between the below: > class myClass(): > class myClass(threading.Thread) the former is a base class, the latter inherits behaviour from the threading.Thread class. *please* read the tutorial before proceeding. -- http://mail.python.o

Re: class problem

2006-08-28 Thread fegge
sorry ,look at this : class myClass: class myClass(threading.Thread): -- http://mail.python.org/mailman/listinfo/python-list

Re: class problem

2006-08-28 Thread Duncan Booth
fegge wrote: > when i declare a class, is there difference between the below: > class myClass(): > class myClass(threading.Thread) > Yes, the first one is a syntax error because you aren't allowed empty parentheses in a class statement but the second one is a syntax error because you don't have

class problem

2006-08-28 Thread fegge
when i declare a class, is there difference between the below: class myClass(): class myClass(threading.Thread) -- http://mail.python.org/mailman/listinfo/python-list

Re: Constructor class problem

2005-03-22 Thread Joal Heagney
Diez B. Roggisch wrote: Wolfgang wrote: Hi, I am a newbie and have to modify some python moduls. I get the followin error: TypeError: __init__() takes exactly 3 arguments (2 given) Here the code snippet: class gXconv: def __init__(self, pathValue): self.pathValue=pathValue self.__

Re: Constructor class problem

2005-03-21 Thread Diez B. Roggisch
Wolfgang wrote: > Hi, > I am a newbie and have to modify some python moduls. > I get the followin error: > TypeError: __init__() takes exactly 3 arguments (2 given) > > Here the code snippet: > class gXconv: > def __init__(self, pathValue): > self.pathValue=pathValue > self.__

Constructor class problem

2005-03-21 Thread Wolfgang
Hi, I am a newbie and have to modify some python moduls. I get the followin error: TypeError: __init__() takes exactly 3 arguments (2 given) Here the code snippet: class gXconv: def __init__(self, pathValue): self.pathValue=pathValue self.__sections = {} self.__spalten