[Python-ideas] Re: Looking for people interested in a Python register virtual machine project

2021-03-22 Thread Skip Montanaro
Thanks for the response. I will try to address your comments inline. > I guess it should be a good idea to answer what's the scope of this > project - is it research one or "production" one? If it's research one, > why be concerned with the churn of over-modern CPython versions? > Wouldn't it be

[Python-ideas] Re: Looking for people interested in a Python register virtual machine project

2021-03-22 Thread Skip Montanaro
> Yeah, that is old writing, so is probably less clear (no pun intended) > than it should be. In frame_dealloc, Py_CLEAR is called for > stack/register slots instead of just Py_XDECREF. Might not be > necessary. Also, the intent is not to change any semantics here. The implementation of

[Python-ideas] Re: Looking for people interested in a Python register virtual machine project

2021-03-22 Thread Skip Montanaro
> In the "Object Lifetime" section you say "registers should be cleared upon > last reference". That isn't safe, since there can be hidden dependencies on > side effects of __del__, e.g.: > > process_objects = create_pipeline() > output_process = process_objects[-1] > return

[Python-ideas] Re: Allow syntax "func(arg=x if condition)"

2021-03-22 Thread Joao S. O. Bueno
I've missed this feature on occasion as well. +1 for whatever that counts; On Mon, 22 Mar 2021 at 17:30, Caleb Donovick wrote: > Never needed this for lists but definitely had the pain for kwargs. Seems > very reasonable for that use case, +0.5. > > In libraries I control I can make sure to

[Python-ideas] Re: Allow syntax "func(arg=x if condition)"

2021-03-22 Thread Caleb Donovick
Never needed this for lists but definitely had the pain for kwargs. Seems very reasonable for that use case, +0.5. In libraries I control I can make sure to use the same default values for functions and their wrappers. However when wrapping functions I don't control there is not a great way to

[Python-ideas] Re: Looking for people interested in a Python register virtual machine project

2021-03-22 Thread Guido van Rossum
As I wrote, Skip’s Porto+PEP is not proposing to delete locals that are not used in the rest of the function, only registers. So the voiced concerns don’t apply. On Sun, Mar 21, 2021 at 23:59 Chris Angelico wrote: > On Mon, Mar 22, 2021 at 5:37 PM Ben Rudiak-Gould > wrote: > > > > On Sun, Mar

[Python-ideas] Re: Itertools generator injection

2021-03-22 Thread Dennis Sweeney
Hm maybe there is something worthwhile here. I implemented a Python version with the same semantics as itertools.product, except only consuming the iterators when absolutely necessary; still only consuming each iterator once, but building its pools incrementally. See

[Python-ideas] Re: Looking for people interested in a Python register virtual machine project

2021-03-22 Thread Chris Angelico
On Mon, Mar 22, 2021 at 5:37 PM Ben Rudiak-Gould wrote: > > On Sun, Mar 21, 2021 at 11:10 PM Chris Angelico wrote: >> >> At what point does the process_objects list cease to be referenced? >> After the last visible use of it, or at the end of the function? > > > In Python as it stands, at the

[Python-ideas] Re: Looking for people interested in a Python register virtual machine project

2021-03-22 Thread Ben Rudiak-Gould
On Sun, Mar 21, 2021 at 11:10 PM Chris Angelico wrote: > At what point does the process_objects list cease to be referenced? > After the last visible use of it, or at the end of the function? In Python as it stands, at the end of the function, as you say. Skip Montanaro's PEP suggested that

[Python-ideas] Re: Looking for people interested in a Python register virtual machine project

2021-03-22 Thread Chris Angelico
On Mon, Mar 22, 2021 at 3:14 PM Guido van Rossum wrote: > > On Sun, Mar 21, 2021 at 3:35 PM Chris Angelico wrote: >> >> On Mon, Mar 22, 2021 at 7:49 AM Ben Rudiak-Gould wrote: >> > >> > In the "Object Lifetime" section you say "registers should be cleared upon >> > last reference". That isn't