Anthony wrote:

> On Mar 25, 2:31 pm, Tzury Bar Yochay <[EMAIL PROTECTED]> wrote:
>> I wish it was that simple but 'a = Foo().getid()' is actually creating
>> a new instance of Foo whereas I want the data of the Foo instanced by
>> __init__ of FooSon().
> 
> I don't think Foo.__init__(self) creates an instance of the Foo
> class.  If you want FooSon to create an instance of Foo, try:

You wrote:

a = Foo().getid()

Which indeed creates a *new* Foo-instance. So it's of no use to the OP.

Of course Foo.<method>(self) calls that method without creating a new
instance, which is the behavior one uses when invoking the constructor of
Foo inside FooSon.__init__. But that doesn't make your example any better.

Diez
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to