Re: [Tutor] Re-instantiate within __init__

2006-04-19 Thread Danny Yoo
> I tried: > > class Omega: >def Display(self): >print self > > class Alpha(Omega): >def __init__(self): >self = Beta() > > class Beta(Omega): >def __init__(self): >pass > > objectus = Alpha() > objectus.Display() > > which prints > > <__main__.Alpha instance at

Re: [Tutor] Re-instantiate within __init__

2006-04-19 Thread Alan Gauld
> is it correct that an object cannot be re-instantiated within it's > __init__ method? There are some tricks you can pull but the object is actually instantiated before the init gets called. Really init is for initialisation of the instance, it's not a true constructor. > Background: I need to

Re: [Tutor] Re-instantiate within __init__

2006-04-19 Thread Kent Johnson
Jan Eden wrote: > Hi, > > is it correct that an object cannot be re-instantiated within it's __init__ > method? > > I tried: > > class Omega: > def Display(self): > print self > > class Alpha(Omega): > def __init__(self): > self = Beta() > > class Beta(

[Tutor] Re-instantiate within __init__

2006-04-19 Thread Jan Eden
Hi, is it correct that an object cannot be re-instantiated within it's __init__ method? I tried: class Omega: def Display(self): print self class Alpha(Omega): def __init__(self): self = Beta() class Beta(Omega): def __init__(self): pass