On May 25, 12:08 pm, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> En Fri, 25 May 2007 05:09:00 -0300, [EMAIL PROTECTED]
> <[EMAIL PROTECTED]> escribió:
>
>
>
> > Vehicle
> > |
> > |--- Two Wheeler
> > | |
> > | |--- BatteryPowered
> > | |--- PetrolPower
En Fri, 25 May 2007 05:09:00 -0300, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> escribió:
> Vehicle
> |
> |--- Two Wheeler
> | |
> | |--- BatteryPowered
> | |--- PetrolPowered
> | |--- DieselPowered
> |
> |--- Three Wheeler
> | |
>
c2 = c1.__base__
>
> > -
> > Suresh
>
> I can't see how your code does what you describe.
>
> > Now, given one of the instance, I want to find the
> > closest relative of the other two.
>
> What influence would an object have over the closest relativ
c2 = c1.__base__
>
> > -
> > Suresh
>
> I can't see how your code does what you describe.
>
> > Now, given one of the instance, I want to find the
> > closest relative of the other two.
>
> What influence would an object have over the closest relativ
hile True:
> if isinstance(a, c1):
> return b
> if isinstance(a, c2):
> return c
> c1 = c1.__base__
> c2 = c1.__base__
>
> -
> Suresh
I can't see how your code does what you describe.
> Now, given one of the instance, I wan
Hi I have three objects, all of them are instances of classes derived
from a base class. Now, given one of the instance, I want to find the
closest relative of the other two. How can I do this?
This is how I implemented; I guess there must be elegant way to do
this...
def find_closest_relative(a