On Tue, Apr 17, 2018 at 03:36:34AM +1000, Chris Angelico wrote:

[further aggressive snippage] *wink*

> > Chris, I must admit that I'm utterly perplexed at this. Your example is
> > as far as from a complex assignment target as you can possibly get. It's
> > a simple name!
> >
> >     i := i + 1
> >
> > The target is just "i", a name.
> 
> Thanks so much for the aggressively-trimmed quote. For once, though,
> TOO aggressive. What you're focusing on is the *unrolled* version of a
> two-line loop. Look at the actual loop, please, and respond to the
> actual question. :|

Ah, I never even picked up on the idea that the previous while loop was 
connected to the following bunch of calls to input(). The code didn't 
seem to be related: the first was already using -> syntax and did not 
use input(), the second used := syntax and did.


> >> The calls to input were in a while loop's header for a reason.
> >> Ignoring them is ignoring the point of assignment expressions.
> >
> > What while loop? Your example has no while loop.
> 
> Not after it got trimmed, no. Here's what I actually said in my original post:
> 
> while (read_next_item() -> items[i + 1 -> i]) is not None:
>     print("%d/%d..." % (i, len(items)), end="\r")
> 
> Now, if THAT is your assignment target, are you still as happy as you
> had been, or are you assuming that the target is a simple name?

I'll give the answer I would have given before I read Nick's comments 
over on Python-Dev: sure, I'm happy, and no, I'm not assuming the 
target is a simple name.

But having seen Nick's response on Python-Dev, I'm now wondering whether 
this should be limited to simple names.

Further discussion in reply to Nick's post over on Python-Dev please.



-- 
Steve
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to