Re: sort(cmp=func)

2008-07-10 Thread Tobiah
On Wed, 09 Jul 2008 20:58:32 -0700, Daniel Fetchinson wrote: >> I have a list of objects that generate code. Some >> of them depend on others being listed first, to >> satisfy dependencies of others. >> >> I wrote a cmp function something like this: >> >> def dep_cmp(ob1, ob2): >> >> i

Re: sort(cmp=func)

2008-07-10 Thread norseman
Tobiah wrote: I have a list of objects that generate code. Some of them depend on others being listed first, to satisfy dependencies of others. I wrote a cmp function something like this: def dep_cmp(ob1, ob2): if ob1.name in ob2.deps: return -1 else

Re: sort(cmp=func)

2008-07-09 Thread David Wahler
On Wed, Jul 9, 2008 at 10:58 PM, Daniel Fetchinson <[EMAIL PROTECTED]> wrote: > > > I have a list of objects that generate code. Some > > of them depend on others being listed first, to > > satisfy dependencies of others. > > > > I wrote a cmp function something like this: > > > > def dep_cmp(ob1,

Re: sort(cmp=func)

2008-07-09 Thread Daniel Fetchinson
> I have a list of objects that generate code. Some > of them depend on others being listed first, to > satisfy dependencies of others. > > I wrote a cmp function something like this: > > def dep_cmp(ob1, ob2): > > if ob1.name in ob2.deps: > return -1 > else: >

sort(cmp=func)

2008-07-09 Thread Tobiah
I have a list of objects that generate code. Some of them depend on others being listed first, to satisfy dependencies of others. I wrote a cmp function something like this: def dep_cmp(ob1, ob2): if ob1.name in ob2.deps: return -1 else: