Re: Find the closest relative

2007-05-25 Thread MRAB
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

Re: Find the closest relative

2007-05-25 Thread Gabriel Genellina
En Fri, 25 May 2007 05:09:00 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: > Vehicle > | > |--- Two Wheeler > | | > | |--- BatteryPowered > | |--- PetrolPowered > | |--- DieselPowered > | > |--- Three Wheeler > | | >

Re: Find the closest relative

2007-05-25 Thread [EMAIL PROTECTED]
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

Re: Find the closest relative

2007-05-25 Thread [EMAIL PROTECTED]
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

Re: Find the closest relative

2007-05-25 Thread 7stud
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

Find the closest relative

2007-05-24 Thread [EMAIL PROTECTED]
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