On Fri, Jun 12, 2020 at 4:55 AM Eric Wieser <wieser.eric+numpy@gmail.com> wrote:
> He thought that the change of del he proposed will give him that behavior, but this is not true.

Unless I'm forgetting part of the conversation, that's not true. Note that the numpy patch is merged. Today, you get the optimization with `z = a + b + c + d`. What you don't get is the same optimization if you use:
```
ab = a + b
abc = ab + c
z = abc + d
```
The language feature I propose is to allow you to _keep_ the optimization that was present in `z = a + b + c + d`, but write it as
```
ab = a + b
abc = (del ab) + c
z = (del abc) + d
```

But does that mean that typing `del x` at the REPL will print the value of `x`? That seems wrong. If `del x` is an expression that returns the value of `x` (and then unbinds it), then the REPL would seem to have no choice but to print the returned value -- the REPL has no indication that it came from `del`.

--
--Guido van Rossum (python.org/~guido)