Re: Inheritance and forward references (prototypes)

2009-06-22 Thread Lorenzo Di Gregorio
On 21 Jun., 22:51, Scott David Daniels scott.dani...@acm.org wrote: LorenzoDiGregoriowrote: On 21 Jun., 01:54, Dave Angel da...@ieee.org wrote: ... class B(object):     def __init__(self,test=None):         if test==None:             test = A()         self.obj =()         return

Re: Inheritance and forward references (prototypes)

2009-06-21 Thread Lorenzo Di Gregorio
On 21 Jun., 01:54, Dave Angel da...@ieee.org wrote: LorenzoDiGregoriowrote: On Jun 20, 8:43 pm, Dave Angel da...@ieee.org wrote: LorenzoDiGregoriowrote: Hi, I'm wondering what would be the preferred way to solve the following forward reference problem:

Re: Inheritance and forward references (prototypes)

2009-06-21 Thread Lie Ryan
Lorenzo Di Gregorio wrote: I had also thought of using None (or whatever else) as a marker but I was curious to find out whether there are better ways to supply an object with standard values as a default argument. In this sense, I was looking for problems ;-) Of course the observation that

Re: Inheritance and forward references (prototypes)

2009-06-21 Thread Scott David Daniels
Lorenzo Di Gregorio wrote: On 21 Jun., 01:54, Dave Angel da...@ieee.org wrote: ... class B(object): def __init__(self,test=None): if test==None: test = A() self.obj =() return ... I had also thought of using None (or whatever else) as a marker but I was

Inheritance and forward references (prototypes)

2009-06-20 Thread Lorenzo Di Gregorio
Hi, I'm wondering what would be the preferred way to solve the following forward reference problem: --- class BaseA(object): def __init__(self): return class DebugA(BaseA): def __init__(self): return # here I would have a prototype of

Re: Inheritance and forward references (prototypes)

2009-06-20 Thread Steven D'Aprano
Lorenzo Di Gregorio wrote: Hi, I'm wondering what would be the preferred way to solve the following forward reference problem: You don't actually explain what is the problem. Fortunately, I'm good at guessing, and I think I can guess what your problem is (see below):

Re: Inheritance and forward references (prototypes)

2009-06-20 Thread Dave Angel
Lorenzo Di Gregorio wrote: Hi, I'm wondering what would be the preferred way to solve the following forward reference problem: --- class BaseA(object): def __init__(self): return class DebugA(BaseA): def __init__(self): return #

Re: Inheritance and forward references (prototypes)

2009-06-20 Thread Piet van Oostrum
Steven D'Aprano st...@removethis.cybersource.com.au (SD) wrote: SD Lorenzo Di Gregorio wrote: Hi, I'm wondering what would be the preferred way to solve the following forward reference problem: SD You don't actually explain what is the problem. Fortunately, I'm good at SD guessing, and I

Re: Inheritance and forward references (prototypes)

2009-06-20 Thread Lorenzo Di Gregorio
On Jun 20, 8:43 pm, Dave Angel da...@ieee.org wrote: Lorenzo Di Gregorio wrote: Hi, I'm wondering what would be the preferred way to solve the following forward reference problem: --- class BaseA(object):     def __init__(self):         return

Inheritance and forward references (prototypes)

2009-06-20 Thread Xavier Ho
Arg, forgot to post to the mailing list again. -_- On a smaller issue, don't you need to do: class DebugA(BaseA): def __init__(self): BaseA.__init__(self) return As in, explicitly call the __init__ function when you initalise DebugA, since DebugA extends BaseA? I'm just

Re: Inheritance and forward references (prototypes)

2009-06-20 Thread Rhodri James
On Sat, 20 Jun 2009 21:26:56 +0100, Lorenzo Di Gregorio lorenzo.digrego...@gmail.com wrote: Thank you for your help: I'm working on a rather large source, but I think I have isolated the problem now. This listing generates an error: --- class