<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Fri, Jun 22, 2018 at 8:09 AM Antoine Pitrou <<a href="mailto:solipsis@pitrou.net">solipsis@pitrou.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thank you. Personally, I'd like to see feedback from<br>
educators/teachers after they take the time to read the PEP and take<br>
some time to think about its consequences.<br></blockquote><div><br></div><div>I've started testing the proposed syntax when I teach. I don't have a large sample yet, but most students either dislike it or don't appreciate the benefits. They state a clear preference for shorter, simpler lines at the consequence of more lines of code. This may partially be caused by the smaller screen real estate on a projector or large TV than a desktop monitor.</div><div><br></div><div>My intuition is that one strength of Python for beginners is the relative lack of punctuation and operators compared with most other languages. This proposal encourages denser lines with more punctuation. Because of the order of operations, many uses of ``:=`` will also require parentheses. Even relatively simple uses, like ``if (match := pattern.search(data)) is not None:`` require doubled parentheses on one side or the other. Beginners are especially prone to typographical errors with mismatched parentheses and missing colons and get easily frustrated by the associated syntax errors.</div><div><br></div><div><br></div><div><div>Given the following options:</div><div><br></div><div>A.</div><div><br></div><div> if (row := cursor.fetchone()) is None:</div><div> raise NotFound</div><div> return row</div><div><br></div><div><br></div><div>B.</div><div><div><br></div><div> row = cursor.fetchone()</div><div> if row is None:</div><div> raise NotFound</div><div> return row</div></div><div><br></div><div><br></div><div>C.</div><div><br></div><div> if (row := cursor.fetchone()) is not None:</div><div> return row</div><div> raise NotFound</div><div><br></div><div><br></div><div>D.</div><div><br></div><div> row = cursor.fetchone()</div><div> if row is not None:</div><div> return row</div><div> raise NotFound</div></div><div><br></div><div><br></div><div>The majority of students preferred option B. I also tested some regex match examples. Results were similar.</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
My main concern is we're introducing a second different way of doing<br>
something which is really fundamental.<br></blockquote><div><br></div><div>The few students who like the proposal ask why it requires creating a new operator instead of repurposing the ``=`` operator.</div><div><br></div><div>I'll reserve my personal opinions for a different thread.</div><br></div></div>