Re: [Python-Dev] Python 3.7: remove all private C functions from the Python C API?

2016-09-11 Thread Benjamin Peterson
That seems like a good idea in abstract. However, the boundaries will have to be delineated. Many functions beginning _Py are effectively part of the public API even for "well-behaved" 3rd-party extensions because they are used by magic macros. For example, _Py_Dealloc is used by Py_DECREF. Ideall

Re: [Python-Dev] [Python-checkins] cpython: Fixes test_getargs2 to get the buildbots working again.

2016-09-11 Thread Steve Dower
On 11Sep2016 1959, Martin Panter wrote: On 12 September 2016 at 02:48, Steve Dower wrote: Fixes test_getargs2 to get the buildbots working again. I'm not sure this is the fix we want to keep here, but it was sufficient to get the test going and unblock all the buildbots. I'm not entirely s

Re: [Python-Dev] [Python-checkins] cpython: Fixes test_getargs2 to get the buildbots working again.

2016-09-11 Thread Martin Panter
On 12 September 2016 at 02:48, Steve Dower wrote: >> Fixes test_getargs2 to get the buildbots working again. > > I'm not sure this is the fix we want to keep here, but it was sufficient to > get the test going and unblock all the buildbots. > > I'm not entirely sure when the break appeared (esse

Re: [Python-Dev] PEP520 and absence of __definition_order__

2016-09-11 Thread Nick Coghlan
On 11 September 2016 at 13:05, Nick Coghlan wrote: > VOC & Batavia *should* be OK (worst case, they return > collections.OrderedDict from __prepare__ and also use it for __dict__ > attributes), but I'm less certain about MicroPython (since I don't > know enough about how its current dict implement

Re: [Python-Dev] [Python-checkins] cpython: Fixes test_getargs2 to get the buildbots working again.

2016-09-11 Thread Steve Dower
On 11Sep2016 1944, steve.dower wrote: https://hg.python.org/cpython/rev/7793d34609cb changeset: 103679:7793d34609cb user:Steve Dower date:Sun Sep 11 19:43:51 2016 -0700 summary: Fixes test_getargs2 to get the buildbots working again. files: Lib/test/test_getargs2.py | 2 +

Re: [Python-Dev] Drastically improving list.sort() for lists of strings/ints

2016-09-11 Thread Elliot Gorokhovsky
Wow, Tim himself! Regarding performance on semi-ordered data: we'll have to benchmark to see, but intuitively I imagine radix would meet Timsort because verifying that a list of strings is sorted takes Omega(nw) (which gives a lower bound on Timsort), where w is the word length. Radix sort is Theta

Re: [Python-Dev] Drastically improving list.sort() for lists of strings/ints

2016-09-11 Thread Petr Viktorin
On 09/11/2016 10:48 PM, Terry Reedy wrote: [...] Second, with respect to timsort in particular: timsort is designed to exploit structure and run faster than O(n*logn) in special cases. If a list is already sorted, timsort will do one O(n) scan and stop. Any radix sort will take several times lo

Re: [Python-Dev] Drastically improving list.sort() for lists of strings/ints

2016-09-11 Thread Tim Peters
[redirected from python-dev, to python-ideas; please send followups only to python-ideas] [Elliot Gorokhovsky ] > ... > TL;DR: Should I spend time making list.sort() detect if it is sorting > lexicographically and, if so, use a much faster algorithm? It will be fun to find out ;-) As Mark, and

Re: [Python-Dev] Python 3.6 dict becomes compact and gets a private version; and keywords become ordered

2016-09-11 Thread Sven R. Kunze
On 11.09.2016 01:41, Nathaniel Smith wrote: I feel like I'm missing something here... by this reasoning, we should *never* change the language spec when new features are added. E.g. if people use async/await in 3.5 then their code won't be compatible with 3.4, but async/await are still part of th

Re: [Python-Dev] Drastically improving list.sort() for lists of strings/ints

2016-09-11 Thread Terry Reedy
On 9/11/2016 3:45 AM, Elliot Gorokhovsky wrote: Hello all, I am interested in making a non-trivial improvement to list.sort(), This is non-trivial, and harder than you seem to think it is. > but before I put in the work, I want to test the waters and see if this is something the community wo

Re: [Python-Dev] Python 3.7: remove all private C functions from the Python C API?

2016-09-11 Thread Raymond Hettinger
> On Sep 11, 2016, at 1:37 AM, Victor Stinner wrote: > > For Python 3.7, I propose that we move all these private functions in > separated header files, maybe Include/private/ or Include/core/, and > not export them as part of the "regular API". > > The risk is that too many C extensions rely o

Re: [Python-Dev] Python 3.7: remove all private C functions from the Python C API?

2016-09-11 Thread Brett Cannon
In general I support cleaning up our C API to more clearly delineate the boundaries of what people can rely on and what they shouldn't. Could we go farther and do the same separation of the base and limited API at the header level instead of interleaving through #ifndef? On Sun, Sep 11, 2016, 01:

Re: [Python-Dev] Drastically improving list.sort() for lists of strings/ints

2016-09-11 Thread Raymond Hettinger
> On Sep 11, 2016, at 11:58 AM, Mark Dickinson wrote: > >> So I suppose the thing to do is to benchmark stable radix sort against >> timsort and see if it's still worth it. > > Agreed; it would definitely be interesting to see benchmarks for the > two-array stable sort as well as the American

Re: [Python-Dev] PEP520 and absence of __definition_order__

2016-09-11 Thread Ethan Furman
On 09/11/2016 01:55 AM, Victor Stinner wrote: 2016-09-10 3:49 GMT-04:00 Ethan Furman wrote: With __definition_order__ Enum can display the actual creation order of enum members and methods, while relying on Enum.__dict__.keys() presents a jumbled mess with many attributes the user never wrote,

Re: [Python-Dev] Drastically improving list.sort() for lists of strings/ints

2016-09-11 Thread Mark Dickinson
On Sun, Sep 11, 2016 at 7:43 PM, Elliot Gorokhovsky wrote: > So I suppose the thing to do is to benchmark stable radix sort against > timsort and see if it's still worth it. Agreed; it would definitely be interesting to see benchmarks for the two-array stable sort as well as the American Flag un

Re: [Python-Dev] Drastically improving list.sort() for lists of strings/ints

2016-09-11 Thread Elliot Gorokhovsky
The sort can be made stable, but that requires the allocation of an equal-sized auxiliary array. To quote from the paper: "Both list-based and two-array sorts entail Θ(n) space overhead. That overhead shrinks to Θ(logn) in American flag sort, which, like quicksort, trades off stability for space ef

Re: [Python-Dev] Drastically improving list.sort() for lists of strings/ints

2016-09-11 Thread Mark Dickinson
> I am interested in making a non-trivial improvement to list.sort() [...] Would your proposed new sorting algorithm be stable? The language currently guarantees stability for `list.sort` and `sorted`. -- Mark ___ Python-Dev mailing list Python-Dev@pyt

Re: [Python-Dev] Drastically improving list.sort() for lists of strings/ints

2016-09-11 Thread Elliot Gorokhovsky
Thanks for the link. If you look at the conclusion it says "We recommend American flag sort as an all-round algorithm for sorting strings." On Sun, Sep 11, 2016, 11:30 AM Raymond Hettinger < raymond.hettin...@gmail.com> wrote: > > > On Sep 11, 2016, at 12:45 AM, Elliot Gorokhovsky > wrote: > > >

Re: [Python-Dev] Drastically improving list.sort() for lists of strings/ints

2016-09-11 Thread Raymond Hettinger
> On Sep 11, 2016, at 12:45 AM, Elliot Gorokhovsky > wrote: > > I am interested in making a non-trivial improvement to list.sort(), but > before I put in the work, I want to test the waters and see if this is > something the community would accept. Basically, I want to implement radix > sort

Re: [Python-Dev] Drastically improving list.sort() for lists of strings/ints

2016-09-11 Thread Chris Angelico
On Sun, Sep 11, 2016 at 5:45 PM, Elliot Gorokhovsky wrote: > I am interested in making a non-trivial improvement to list.sort(), but > before I put in the work, I want to test the waters and see if this is > something the community would accept. Basically, I want to implement radix > sort for list

[Python-Dev] Drastically improving list.sort() for lists of strings/ints

2016-09-11 Thread Elliot Gorokhovsky
Hello all, I am interested in making a non-trivial improvement to list.sort(), but before I put in the work, I want to test the waters and see if this is something the community would accept. Basically, I want to implement radix sort for lists of strings. So list.sort() would detect if it is sorti

Re: [Python-Dev] [Python-checkins] cpython: Use HTTP in testPythonOrg

2016-09-11 Thread Eric V. Smith
Hi, Berker. Could you add a comment to the test on why this should use http? I can see this bouncing back and forth between http and https, as people clean an up all http usages to be https. Thanks. Eric. On 9/11/2016 8:46 AM, berker.peksag wrote: https://hg.python.org/cpython/rev/bc085b7e8

Re: [Python-Dev] Python 3.6 dict becomes compact and gets a private version; and keywords become ordered

2016-09-11 Thread Chris Angelico
On Sun, Sep 11, 2016 at 6:42 PM, Victor Stinner wrote: > 2016-09-10 23:24 GMT-04:00 Nick Coghlan : >> To conform with the updated language spec, implementations just need >> to use collections.OrderedDict in 3 places: >> >> (...) >> - storage type for passing kwargs to functions > > I'm not sure a

Re: [Python-Dev] PEP520 and absence of __definition_order__

2016-09-11 Thread Victor Stinner
2016-09-10 3:49 GMT-04:00 Ethan Furman : > With __definition_order__ Enum can display the actual creation order of enum > members and methods, while relying on Enum.__dict__.keys() presents a > jumbled mess with many attributes the user never wrote, the enum members > either > appearing /after/ al

Re: [Python-Dev] Python 3.6 dict becomes compact and gets a private version; and keywords become ordered

2016-09-11 Thread Victor Stinner
2016-09-10 23:24 GMT-04:00 Nick Coghlan : > To conform with the updated language spec, implementations just need > to use collections.OrderedDict in 3 places: > > (...) > - storage type for passing kwargs to functions I'm not sure about the "just need" for this one, especially if you care of perfo

[Python-Dev] Python 3.7: remove all private C functions from the Python C API?

2016-09-11 Thread Victor Stinner
Hi, Currently, Python has 3 C API: * python core API * regular API: subset of the core API * stable API (ABI?), the Py_LIMITED_API thing: subset of the regular API For practical purpose, all functions are declared in Include/*.h. Basically, Python exposes "everything". There are private function

Re: [Python-Dev] [Webmaster] A broken link!

2016-09-11 Thread Steve Holden
On Sat, Sep 10, 2016 at 6:57 PM, Nick Coghlan wrote: > P.S. Although in this case, it may have just been a direct link to the > 3.2 version of the 3.2 What's New - there isn't a lot we can do about > that, as when a branch goes unsupported, we usually stop updating the > docs as well (even when e