Re: "Natural" use of cmp= in sort

2014-11-12 Thread Paddy
On Tuesday, 11 November 2014 18:07:27 UTC, Ian wrote: > The example that I posted is one that I recall being brought up on > this list in the past, but I don't have a link for you. THanks Ian for your help in this. -- https://mail.python.org/mailman/listinfo/python-list

Re: "Natural" use of cmp= in sort

2014-11-11 Thread Ian Kelly
On Tue, Nov 11, 2014 at 2:21 AM, Paddy wrote: > On Tuesday, 11 November 2014 09:07:14 UTC, Ian wrote: >> On Tue, Nov 11, 2014 at 12:44 AM, Paddy wrote: >> > Thanks Ian. The original author states "...and it is sure that the given >> > inputs will give an output, i.e., the inputs will always be

Re: "Natural" use of cmp= in sort

2014-11-11 Thread Paddy
On Tuesday, 11 November 2014 09:07:14 UTC, Ian wrote: > On Tue, Nov 11, 2014 at 12:44 AM, Paddy wrote: > > Thanks Ian. The original author states "...and it is sure that the given > > inputs will give an output, i.e., the inputs will always be valid.", which > > could be taken as meaning that a

Re: "Natural" use of cmp= in sort

2014-11-11 Thread Ian Kelly
On Tue, Nov 11, 2014 at 12:44 AM, Paddy wrote: > Thanks Ian. The original author states "...and it is sure that the given > inputs will give an output, i.e., the inputs will always be valid.", which > could be taken as meaning that all inputs are sufficient, well formed, and > contain all relat

Re: "Natural" use of cmp= in sort

2014-11-10 Thread Paddy
On Tuesday, 11 November 2014 06:37:18 UTC, Ian wrote: > On Mon, Nov 10, 2014 at 8:09 PM, Paddy wrote: > > On Monday, 10 November 2014 18:45:15 UTC, Paddy wrote: > >> Hi, I do agree with > >> Raymond H. about the relative m

Re: "Natural" use of cmp= in sort

2014-11-10 Thread Ian Kelly
On Mon, Nov 10, 2014 at 8:09 PM, Paddy wrote: > On Monday, 10 November 2014 18:45:15 UTC, Paddy wrote: >> Hi, I do agree with >> Raymond H. about the relative merits of cmp= and key= in >> sort/sorted, but I decided to als

Re: "Natural" use of cmp= in sort

2014-11-10 Thread Paddy
On Monday, 10 November 2014 18:45:15 UTC, Paddy wrote: > Hi, I do agree with >Raymond H. about the relative merits of cmp= and key= in > sort/sorted, but I decided to also not let natural uses of cmp= pass silently. > > I

Re: "Natural" use of cmp= in sort

2014-11-10 Thread Paddy
On Monday, 10 November 2014 19:44:39 UTC, Ian wrote: > On Mon, Nov 10, 2014 at 12:19 PM, Peter Otten wrote: > > I'm not sure this works. I tried: > > Here's a simpler failure case. > > >>> ineq = """f2 > f3 > ... f3 > f1""" > > [Previously posted code elided] > > >>> greater_thans > set([('f3

Re: "Natural" use of cmp= in sort

2014-11-10 Thread Ian Kelly
On Mon, Nov 10, 2014 at 12:19 PM, Peter Otten <__pete...@web.de> wrote: > I'm not sure this works. I tried: Here's a simpler failure case. >>> ineq = """f2 > f3 ... f3 > f1""" [Previously posted code elided] >>> greater_thans set([('f3', 'f1'), ('f2', 'f3')]) >>> sorted(all_f, cmp=lambda t1, t2

Re: "Natural" use of cmp= in sort

2014-11-10 Thread Peter Otten
Paddy wrote: > Hi, I do agree with > Raymond H. about the relative merits of cmp= and key= in > sort/sorted, but I decided to also not let natural uses of cmp= pass > silently. > > In answering this question, http://stackove

"Natural" use of cmp= in sort

2014-11-10 Thread Paddy
Hi, I do agree with Raymond H. about the relative merits of cmp= and key= in sort/sorted, but I decided to also not let natural uses of cmp= pass silently. In answering this question, http://stackoverflow.com/a/26850434/105