Re: [Python-ideas] + operator on generators

2017-07-01 Thread Steven D'Aprano
On Sat, Jul 01, 2017 at 01:35:29AM -0500, Wes Turner wrote: > On Saturday, July 1, 2017, Steven D'Aprano wrote: > > > On Fri, Jun 30, 2017 at 01:09:51AM +0200, Jan Kaliszewski wrote: > > > > [...] > > > > But the more I think about it the more I agree with Nick. Let's start > > by moving itertool

Re: [Python-ideas] + operator on generators

2017-07-01 Thread Chris Angelico
On Sat, Jul 1, 2017 at 6:11 PM, Steven D'Aprano wrote: >> - So there's then a new conditional import (e.g. in a compat package)? What >> does this add? > > try: chain > except NameError: from itertools import chain > > Two lines, if and only if you both need chain and want to support > versions

Re: [Python-ideas] + operator on generators

2017-07-01 Thread Paul Moore
On 1 July 2017 at 07:13, Steven D'Aprano wrote: > But the more I think about it the more I agree with Nick. Let's start > by moving itertools.chain into built-ins, with zip and map, and only > consider giving it an operator after we've had a few years of experience > with chain as a built-in. We m

Re: [Python-ideas] + operator on generators

2017-07-01 Thread Wes Turner
On Saturday, July 1, 2017, Steven D'Aprano wrote: > On Sat, Jul 01, 2017 at 01:35:29AM -0500, Wes Turner wrote: > > On Saturday, July 1, 2017, Steven D'Aprano > wrote: > > > > > On Fri, Jun 30, 2017 at 01:09:51AM +0200, Jan Kaliszewski wrote: > > > > > > [...] > > > > > > But the more I think ab

Re: [Python-ideas] CPython should get...

2017-07-01 Thread Brett Cannon
On Fri, Jun 30, 2017, 10:38 Koos Zevenhoven, wrote: > On Jun 30, 2017 5:16 PM, "Oleg Broytman" wrote: > > On Fri, Jun 30, 2017 at 12:09:52PM -0300, "Soni L." > wrote: > > CPython should get a > >You're welcome to create one. Go on, send your pull requests! > > > But if you are planning to d

Re: [Python-ideas] CPython should get...

2017-07-01 Thread Oleg Broytman
Hi, All! On Sat, Jul 01, 2017 at 04:22:31PM +, Brett Cannon wrote: > On Fri, Jun 30, 2017, 10:38 Koos Zevenhoven, wrote: > > On Jun 30, 2017 5:16 PM, "Oleg Broytman" wrote: > > > > On Fri, Jun 30, 2017 at 12:09:52PM -0300, "Soni L." > > wrote: > > > CPython should get a > > > >You're w

Re: [Python-ideas] CPython should get...

2017-07-01 Thread Nick Timkovich
On Sat, Jul 1, 2017 at 1:17 PM, Oleg Broytman wrote: > >I think the sentence "Python should have implement feature>" should be ;-) forbidden if it is not followed with > "I'm in the middle of development. Expect the 1st PR in timeframe>." > >Python can only have features that You, the ,

Re: [Python-ideas] CPython should get...

2017-07-01 Thread Paul Moore
On 1 July 2017 at 18:35, Nick Timkovich wrote: > Devil's advocate: why prepare a patch and submit it if it is going to be > dismissed out of hand. Trying to gauge support for the idea is a reasonable > first-step. That's perfectly OK, but it's important to phrase the email in a way that makes tha

Re: [Python-ideas] Bytecode JIT

2017-07-01 Thread Victor Stinner
Let's say that you have a function "def mysum (x; y): return x+y", do you always want to use your new IADD instruction here? What if I call mysum ("a", "b")? Victor ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/lis

Re: [Python-ideas] Bytecode JIT

2017-07-01 Thread Soni L.
On 2017-07-01 07:34 PM, Victor Stinner wrote: Let's say that you have a function "def mysum (x; y): return x+y", do you always want to use your new IADD instruction here? What if I call mysum ("a", "b")? Victor Let's say that you do. Given how short it is, it would just get inlined. Your

Re: [Python-ideas] Bytecode JIT

2017-07-01 Thread Chris Angelico
On Sun, Jul 2, 2017 at 8:52 AM, Soni L. wrote: > On 2017-07-01 07:34 PM, Victor Stinner wrote: >> >> Let's say that you have a function "def mysum (x; y): return x+y", do you >> always want to use your new IADD instruction here? What if I call mysum >> ("a", "b")? >> >> Victor > > > Let's say that

Re: [Python-ideas] Bytecode JIT

2017-07-01 Thread rym...@gmail.com
This is literally PyPy. There's little reason for something like this to end up in official CPython, at least for now. -- Ryan (ライアン) Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone elsehttp://refi64.com On Jul 1, 2017 at 5:53 PM, > wrote: On 2017-07-01 07:34 PM, Victor St

Re: [Python-ideas] Bytecode JIT

2017-07-01 Thread Soni L.
On 2017-07-01 11:57 PM, rym...@gmail.com wrote: This is literally PyPy. There's little reason for something like this to end up in official CPython, at least for now. It's literally not PyPy. PyPy's internal bytecode, for one, does have typechecks. And PyPy emits machine code, which is not s

Re: [Python-ideas] Bytecode JIT

2017-07-01 Thread Steven D'Aprano
On Sat, Jul 01, 2017 at 07:52:55PM -0300, Soni L. wrote: > > > On 2017-07-01 07:34 PM, Victor Stinner wrote: > >Let's say that you have a function "def mysum (x; y): return x+y", do > >you always want to use your new IADD instruction here? What if I call > >mysum ("a", "b")? > > > >Victor > >

Re: [Python-ideas] Bytecode JIT

2017-07-01 Thread Chris Angelico
On Sun, Jul 2, 2017 at 3:41 PM, Steven D'Aprano wrote: >> Let's say that you do. Given how short it is, it would just get inlined. >> Your call of mysum ("a", "b") would indeed not use IADD, nor would it be >> a call. It would potentially not invoke any operators, but instead get >> replaced with