<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><span class="gmail-"></span><span class="gmail-"></span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">In terms of language proposals, you can't just say "don't need values<br>
for"; the semantics have to be EITHER "consume and discard" OR "don't<br>
consume". We already have a perfectly good way of spelling "consume<br>
and discard":<br>
<br>
x, y, _ = iter<br></blockquote><div><br></div><div>You mean ( x, y, *_ = iter ) ?<span class="gmail-"></span></div><div><span class="gmail-"></span><br><span class="gmail-"></span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">
</span>Since this has to be about non-consumption of the generator/iterator,<br>
Ellipsis cannot be a zero-length deque. Thus this syntax would have to<br>
be restricted to the *last* entry, and it then means "don't check for<br>
more elements".<br>
</blockquote><div><br></div><div>Yes, you are right to the *last* entry. (*last* depends on proposed syntax (spelling)).<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
The proposed semantics, if I understand you correctly, are:<br>
<br>
try:<br>
    _iter = iter(it)<br>
    x = next(_iter)<br>
    y = next(_iter)<br>
except StopIteration:<br>
    raise ValueError<br>
# no "else" clause, we're done here<br></blockquote><div><br></div><div>Yes, "roughly" this semantics is proposed, with some assumptions on  _iter = iter(it). <span id="gmail-result_box" class="gmail-short_text" lang="en"><span class="gmail-"><br></span></span></div><div><span id="gmail-result_box" class="gmail-short_text" lang="en"><span class="gmail-">As I can see at the moment, these cases should behave differently:</span></span></div><div><span id="gmail-result_box" class="gmail-short_text" lang="en"><span class="gmail-"><br></span></span></div><div><span id="gmail-result_box" class="gmail-short_text" lang="en"><span class="gmail-">>>> x, y = [1,2,3,4]             # must raise ValueError<br></span></span></div><div><span id="gmail-result_box" class="gmail-short_text" lang="en"><span class="gmail-">>>> x, y = iter([1,2,3,4])      # should work</span></span></div><div><span id="gmail-result_box" class="gmail-short_text" lang="en"><span class="gmail-"><br></span></span></div><div><span id="gmail-result_box" class="gmail-short_text" lang="en"><span class="gmail-">But at the same time, it violates current situation.</span></span><span id="gmail-result_box" class="gmail-short_text" lang="en"><span class="gmail-"><span id="gmail-result_box" class="gmail-short_text" lang="en"><span class="gmail-"> So maybe, as you have said we need special syntax. I will think about it.<br></span></span></span></span></div><div></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Start by perusing PEP 1, and the template in PEP 12:<br>
<br>
<a href="https://www.python.org/dev/peps/pep-0001/" rel="noreferrer" target="_blank">https://www.python.org/dev/<wbr>peps/pep-0001/</a><br>
<a href="https://www.python.org/dev/peps/pep-0012/" rel="noreferrer" target="_blank">https://www.python.org/dev/<wbr>peps/pep-0012/</a><br>
<br>
The PEP editors (myself included) are here to help you; don't hesitate<br>
to reach out with questions.<br></blockquote><div><br></div><div>Thank you!</div><div><br></div><div>With kind regards, -gdg<br></div></div><br></div></div>