This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Sergey.Kirpichev
Recipients Sergey.Kirpichev, benjamin.peterson, mark.dickinson, matrixise, r.david.murray, rhettinger, tim.peters
Date 2015-04-29.17:25:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <20150429172529.GA5157@darkstar.order.hcn-strela.ru>
In-reply-to <1430321115.3029944.260219509.75AC7FA9@webmail.messagingengine.com>
Content
On Wed, Apr 29, 2015 at 03:25:19PM +0000, Benjamin Peterson wrote:
> So, basically you need a base case for recursion? What's wrong with
> explicitly writing that out?

Because it's complex (and costly).  This is not a trivial test and
I don't see reasons to fix that is not broken.  And it will be difficult
to explain for readers: remember, I need this exceptional case only in
the world with a strange Python's convention (Python try to sort a list
when it doesn't make sense).

Mathematical algorithm is not broken - programming language is.

Here is C:
https://sourceware.org/git/?p=glibc.git;a=blob;f=stdlib/msort.c;#l45
Here is Ruby:
https://github.com/ruby/ruby/blob/trunk/array.c#L2454

> It's practical if you have a broken key function and test it with a one
> element list.

It's silly to test key function on a single-element list *only*.

> > BTW, why this issue was closed?
> 
> 3 of us agreed this doesn't seem like a suitable change.

And 1 seems to be ok with patch.  Is this just a question of
number of votes?

At least, please consider this as a documentation issue.  That ...
feature may be obvious for a Python developer, but not for
mathematician (as well as ordinary Python user).

When key function value has no sense at all - it's not clear from
the documentation, that the key function will be called.
History
Date User Action Args
2015-04-29 17:25:36Sergey.Kirpichevsetrecipients: + Sergey.Kirpichev, tim.peters, rhettinger, mark.dickinson, benjamin.peterson, r.david.murray, matrixise
2015-04-29 17:25:36Sergey.Kirpichevlinkissue24075 messages
2015-04-29 17:25:35Sergey.Kirpichevcreate