> 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
> 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
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(
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