Hello,

On Sat, 6 Feb 2021 10:46:54 +0200
Serhiy Storchaka <storch...@gmail.com> wrote:

> 05.02.21 09:51, Paul Sokolovsky пише:
> > a0 = 0
> > b0 = 10
> > while ((a1, b1) := phi([a0, a2], [b0, b2]))[0] < 5:
> >     a2 = a1 + 1
> >     b2 = b1 + 1  
> 
> Such code quickly becomes unreadable. Especially if in real code
> function has additional arguments and names are longer that 2-3
> characters.

But at least it fully corresponds to the original statements and control
flow of the program, that's the point!

> The following code is not much larger but more clear and extensible:
> 
> a0 = 0
> b0 = 10
> while True:
>     a1, b1 := phi([a0, a2], [b0, b2]))
>     if b1 >= 5:
>         break
>     a2 = a1 + 1
>     b2 = b1 + 1

As I mentioned in other replies, that's what I've been doing. But that
does *NOT* correspond to the original program, or SSA conversion of it.
Instead, it's SSA + random munging. And when debugging SSA, you may
argue what's worse: to look at 3-stories phi's, or to look at the code
structure which doesn't correspond to the input code.


But that's not the point. I now in https://bugs.python.org/issue43143
gave more down to earth example:

For as long as you agree that following is acceptable:

func(a := val)

, then I'd say it really doesn't make much sense to argue that
following should not be acceptable:

min((b, a) := (a, b))



-- 
Best regards,
 Paul                          mailto:pmis...@gmail.com
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/GBEIWEZGULUXJMSNILMNUF2WGOZQA46N/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to