Re: [Python-Dev] Let's change to C API!

2018-08-22 Thread Antoine Pitrou
On Thu, 23 Aug 2018 13:34:02 +1200 Greg Ewing wrote: > Neil Schemenauer wrote: > > Perhaps a "argument clinic on steroids" would be the proper > > approach. So, extensions would mostly be written in C. However, we > > would have a pre-processor that does some "magic" to make using the > >

Re: [Python-Dev] Let's change to C API!

2018-08-22 Thread Greg Ewing
Neil Schemenauer wrote: Perhaps a "argument clinic on steroids" would be the proper approach. So, extensions would mostly be written in C. However, we would have a pre-processor that does some "magic" to make using the Python API cleaner. You seem to have started on the train of thought that

Re: [Python-Dev] Let's change to C API!

2018-08-22 Thread Neil Schemenauer
On 2018-07-31, Victor Stinner wrote: > I would be nice to be able to use something to "generate" C > extensions, maybe even from pure Python code. But someone has to > work on a full solution to implement that. Perhaps a "argument clinic on steroids" would be the proper approach. So, extensions

Re: [Python-Dev] Issue?

2018-08-22 Thread Tim Peters
I wrote Python's sort, so I may know something about it ;-) To my eyes, no, there's not "an issue" here, but a full explanation would be very involved. For some sorting algorithms, it's possible to guarantee a redundant comparison is never made. For example, a pure insertion sort. But Python's

Re: [Python-Dev] Starting to use gcc-8 on upstream Python project CI

2018-08-22 Thread 有賀淳/Jun Aruga
Hi Brett, > So is the request simply to use gcc 8 instead of what Travis uses as the > default gcc? Yes, you are right. > IOW change > https://github.com/python/cpython/blob/28853a249b1d0c890b7e9ca345290bb8c1756446/.travis.yml#L71 > somehow to use gcc8 specifically? If we just change only

Re: [Python-Dev] Starting to use gcc-8 on upstream Python project CI

2018-08-22 Thread Brett Cannon
So is the request simply to use gcc 8 instead of what Travis uses as the default gcc? IOW change https://github.com/python/cpython/blob/28853a249b1d0c890b7e9ca345290bb8c1756446/.travis.yml#L71 somehow to use gcc8 specifically? Since it's only used for the code coverage build I don't think anyone

Re: [Python-Dev] Issue?

2018-08-22 Thread Chris Barker via Python-Dev
python used the "timsort" sorting routine: https://en.wikipedia.org/wiki/Timsort So you can look at that and confirm that this is correct behaviour (I'm betting it is :-) But in general, sorting is O(n log(n)) -- there are going to be more than n comparisons. If comparing is slow, you want to

Re: [Python-Dev] Issue?

2018-08-22 Thread Steven D'Aprano
On Wed, Aug 22, 2018 at 06:40:42PM +0800, 楼晓峰 wrote: > Why compare twice? This is not a mailing list for asking for help with your own code. You can try this list instead: https://mail.python.org/mailman/listinfo/python-list -- Steve ___

[Python-Dev] Issue?

2018-08-22 Thread ??????
Why compare twice? class Student(object): def __init__(self, name, score): self.name = name self.score = score def __str__(self): return '(%s: %s)' % (self.name, self.score) __repr__ = __str__ def __lt__(self, s): #print(self, '--', s)