Re: [Tutor] lazily decorated sort

2012-09-28 Thread eryksun
On Fri, Sep 28, 2012 at 3:34 PM, Peter Otten <__pete...@web.de> wrote: > >> Also, as far as I can see in the code, implementing "total_ordering" >> is unnecessary for sorting. One only needs to implement __lt__. It's >> used by binarysort() to test the pivot via the IFLT/ISLT macros: >> >> http://h

Re: [Tutor] lazily decorated sort

2012-09-28 Thread Peter Otten
eryksun wrote: > On Fri, Sep 28, 2012 at 8:17 AM, Peter Otten <__pete...@web.de> wrote: >> >> def make_key(keys): >> @total_ordering >> class Key(object): >> def __init__(self, value): >> self._keys = keys(value) >> self._cached = [] > > > Using a generato

Re: [Tutor] lazily decorated sort

2012-09-28 Thread eryksun
On Fri, Sep 28, 2012 at 8:17 AM, Peter Otten <__pete...@web.de> wrote: > > def make_key(keys): > @total_ordering > class Key(object): > def __init__(self, value): > self._keys = keys(value) > self._cached = [] Using a generator/iterator to pump the key valu

Re: [Tutor] lazily decorated sort

2012-09-28 Thread Peter Otten
Chris Smith wrote: > I'm wondering if anyone has seen or knows of a good way to do a lazily > decorated sort. I was reading about how good the DSU (decorate, sort, > undecorate) approach is but the problem that we are running into in > SymPy is that we want to get by with a fast hash sort if possi

Re: [Tutor] lazily decorated sort

2012-09-28 Thread Steven D'Aprano
On 11/09/12 21:44, Chris Smith wrote: Hi all, I'm wondering if anyone has seen or knows of a good way to do a lazily decorated sort. I was reading about how good the DSU (decorate, sort, undecorate) approach is but the problem that we are running into in SymPy is that we want to get by with a fa

Re: [Tutor] lazily decorated sort

2012-09-28 Thread Mark Lawrence
On 11/09/2012 12:44, Chris Smith wrote: Hi all, I'm wondering if anyone has seen or knows of a good way to do a lazily decorated sort. I was reading about how good the DSU (decorate, sort, undecorate) approach is but the problem that we are running into in SymPy is that we want to get by with a

[Tutor] lazily decorated sort

2012-09-28 Thread Chris Smith
Hi all, I'm wondering if anyone has seen or knows of a good way to do a lazily decorated sort. I was reading about how good the DSU (decorate, sort, undecorate) approach is but the problem that we are running into in SymPy is that we want to get by with a fast hash sort if possible, and only decor