> No need to have an object there - you could just define it as a syntactic 
> construct instead. Assignment targets aren't themselves objects (although the 
> same syntax can often be used on the RHS, when it would resolve to one).

Right. Thanks. That _should_ have been obvious. :)

> Having a way to say "allow additional elements without iterating over them" 
> would be useful, but creating a new way to spell the non-assignment wouldn't 
> be of sufficiently great value to justify the syntax IMO.

I mostly agree. I included that option for completeness. It would still have 
the benefit of avoiding the memory usage of creating a list and keeping 
references to the items until the list itself can be collected.

Come to think of it, can (or could) Python already optimize that using current 
syntax, noticing that the variable assigned to is never used after it is 
"assigned" to? If that optimization were implemented (I presume it is not 
implemented now) then there is actually no point to this proposal at all except 
to allow "..." in final positions in the expression to the left of "=" and to 
have that mean to not iterate.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/AHUOIVOS4GXHAI3AT7O5M2MI4BJJER24/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to