<div dir="ltr"><div class="gmail_quote">[Alexander Belopolsky]<br>>>> ...<br>>>>  I also think that the dreadfulness of mistyping = where == is expected<br>>>>  is exaggerated.<br><br>[Tim]<br>>> There are a number of core devs who would be rabidly opposed</div><div class="gmail_quote">>> to allowing that confusion in Python, due to still-remembered</div><div class="gmail_quote">>> real-life nightmares in C.  For example, me ;-)  It only takes one<br>>> wasted day of debugging that typo in a time-critical project to sour</div><div class="gmail_quote">>> you on it for life, and several of us run out of fingers counting the</div><div class="gmail_quote">>> number of days it actually did cost over our C careers.<br><br>[Alexander]<br>> I still do quite a bit of C programming and I have exactly the opposite</div><div class="gmail_quote">> experience<br><br>Meaning that confusing "=" and "==" in C _saves_ you days of debugging in time-critical projects? ;-)<br><br>> given modern environments: why is gcc/clang/vs complaining about if (x=a) -<br>> I know what I am doing!<br><br>Because gcc/clang/vs is acknowledging how widely and deeply this C wart is despised.  Isn't that obvious?  You're quite the exception here, not "the rule" - as gcc/clang/vs eternally but apparently futilely remind you ;-)<br><br></div><div class="gmail_quote">...</div><div class="gmail_quote">> Seriously, ':=' looks like a reluctantly introduced kludge to allow</div><div class="gmail_quote">> assignment in expressions.<br><br>There have been piles of other suggestions, but ":=" remains the least disliked (at least by Guido, and his opinion actually counts ;-) ).<br><br>> We agree that it is sometimes useful to have, but we will make the feature</div><div class="gmail_quote">> really hard to use<br><br>?  It's very easy to use.  Try it - I have.  But I've used several languages in which ":=" was _the_ way to spell assignment, so it felt familiar at first touch.<br><br><br></div><div class="gmail_quote">> or discover.<br><br>It doesn't even exist yet, but Googling on</div><div class="gmail_quote"><br></div><div class="gmail_quote">    python operator :=<br><br>already returns a directly relevant hit on the first page for me:<br><br>    <a href="https://stackoverflow.com/questions/26000198/what-does-colon-equal-in-python-mean" target="_blank">https://stackoverflow.com/questions/26000198/what-does-colon-equal-in-python-mean</a></div><div class="gmail_quote"><br></div><div class="gmail_quote">The hits above it are all to overviews of Python operators.  Here on Windows, the interface to the Python doc files in IDLE contains an entry for each operator, so just typing := in the index search box will eventually go directly to its docs.  If you can't do something similar on Linux, upgrade to Windows ;-)</div><div class="gmail_quote"><br></div><div class="gmail_quote">>  What happened to the "consenting adults" philosophy?<br><br>Struggling mightily the last several months to get consensus on some form of embedded assignment _at all_ :-(<br><br>>  Do we want to protect users who cannot tell = from ==</div><div class="gmail_quote"><br></div><div class="gmail_quote">Yes.</div><div class="gmail_quote"><br>>  so much that  we are willing to cause Python to be the first language<br>> with two non-interchangeable assignment operators?<br><br>Sure - I am.  _Far_ more than I'm willing to reproduce C's mistake.  It's one of the first things singled out in Andrew Koenig's "C Traps and Pitfalls", starting with his original paper that was the basis for his 1989 book of the same name:<br><br>    <a href="http://literateprogramming.com/ctraps.pdf">http://literateprogramming.com/ctraps.pdf</a><br><br>You can use Google too - it's a top-10 item in every list of "C warts" I've ever seen.  It's impossible to overstate how hated it is.<br><br>But, sure - if you post in its defense a few more times, everyone sensible is sure to change their mind - and I'll ask Andrew to remove that section from his still-selling book ;-)<br><br></div><div class="gmail_quote"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">I solved the problem in my own code by using an editor that displays a single "=" in C source as a left-arrow graphic (that's one of its C-specific display options - again a response to how notorious this bug-magnet is)</span>.  So assignment and equality-testing in C code look entirely different to me, regardless of context.</div><div class="gmail_quote"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br>But to this day, I routinely get a SyntaxError when writing new Python code because I _think_ "if x equals y" and _type_ "if x = y:".  So I know for sure that it's still a typo I'm way too prone to make.<br><br>I've picked up that you're not, but that's scant comfort ;-)<br><br></span></div></div>