Re: Newbie Question regarding __init__()

2009-08-04 Thread Simon
On Aug 3, 11:00 pm, Dave Angel wrote: > Simon wrote: > > On Aug 2, 5:51 am, Dave Angel wrote: > > >> > >> I don't understand your comparison to Foxpro.  read on. > > >> As your code was last posted, you don't need a return value from > >> init_Exec()  Every function that doesn't have an explicit

Re: Newbie Question regarding __init__()

2009-08-04 Thread Dave Angel
Dennis Lee Bieber wrote: On Mon, 03 Aug 2009 23:00:13 -0400, Dave Angel declaimed the following in gmane.comp.python.general: To throw away the result of an expression in Python is even easier. Just don't use it. func1() and func2() is a valid expression whose result is not used.

Re: Newbie Question regarding __init__()

2009-08-03 Thread Dave Angel
Simon wrote: On Aug 2, 5:51 am, Dave Angel wrote: I don't understand your comparison to Foxpro. read on. As your code was last posted, you don't need a return value from init_Exec() Every function that doesn't have an explicit return will return None. And None is interpreted as False in

Re: Newbie Question regarding __init__()

2009-08-03 Thread Simon
On Aug 2, 5:51 am, Dave Angel wrote: > Simon wrote: > > Okay I will fix my code and include "self" and see what happens.  I > > know I tried that before and got another error which I suspect was > > another newbie error. > > > The idea behind the init_Pre is that I can put custom code here to > >

Re: Newbie Question regarding __init__()

2009-08-02 Thread Dave Angel
Simon wrote: Okay I will fix my code and include "self" and see what happens. I know I tried that before and got another error which I suspect was another newbie error. The idea behind the init_Pre is that I can put custom code here to customize the __init__ instead of creating a new subclass.

Re: Newbie Question regarding __init__()

2009-08-01 Thread Simon
Okay I will fix my code and include "self" and see what happens. I know I tried that before and got another error which I suspect was another newbie error. The idea behind the init_Pre is that I can put custom code here to customize the __init__ instead of creating a new subclass. This kind of h

Re: Newbie Question regarding __init__()

2009-08-01 Thread Dave Angel
Nat Williams wrote: As MRAB described, ALL instance methods need to accept 'self' as a first parameter, as that will be passed to them implicitly when they are called. This includes __init__. The name 'self' is just a commonly accepted convention for the name of the instance object passed to met

Re: Newbie Question regarding __init__()

2009-07-31 Thread Gabriel Genellina
En Sat, 01 Aug 2009 00:13:05 -0300, Nat Williams escribió: One other thing. I'm a little confused by the first line of dcObject.__init__: self.init_Pre() and self.init_Exec() I suspect this does not do what you think it does. init_Pre and init_Exec will both be called by this expression

Re: Newbie Question regarding __init__()

2009-07-31 Thread Gabriel Genellina
En Fri, 31 Jul 2009 22:53:47 -0300, Simon escribió: So should the dcObject class include the "self" as well since I have not defined an __init__ method in dcCursor? Every method that you define takes "self" as its first argument. Every method that you want to call on the current instance mu

Re: Newbie Question regarding __init__()

2009-07-31 Thread Nat Williams
As MRAB described, ALL instance methods need to accept 'self' as a first parameter, as that will be passed to them implicitly when they are called. This includes __init__. The name 'self' is just a commonly accepted convention for the name of the instance object passed to methods. You don't have

Re: Newbie Question regarding __init__()

2009-07-31 Thread Simon
Hi So should the dcObject class include the "self" as well since I have not defined an __init__ method in dcCursor? Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie Question regarding __init__()

2009-07-31 Thread MRAB
Simon wrote: Hi I want to create an instance of dcCursor which inherits from dcObject. When I run the following code it gives the error shown. Can some explain to me what is wrong? I have included the dcObject.py and dcCursor.py below. import dcObject import dcCursor x = dcCursor.dcCursor()

Newbie Question regarding __init__()

2009-07-31 Thread Simon
Hi I want to create an instance of dcCursor which inherits from dcObject. When I run the following code it gives the error shown. Can some explain to me what is wrong? I have included the dcObject.py and dcCursor.py below. >>>import dcObject >>> import dcCursor >>> x = dcCursor.dcCursor() Traceb