WTFPython – Understanding Python through surprising snippets
It&#x27;s a good repo, but remember a lot of those are &quot;A Good Thing™&quot;.<p>The first snippet is a very good example:<p><pre><code>    a := &quot;wtf_walrus&quot;
</code></pre>
doesn&#x27;t work while:<p><pre><code>   (a := &quot;wtf_walrus&quot;)
</code></pre>
works.<p>It&#x27;s a fantastic design decision.<p>Python took a long time before getting this operator, because it&#x27;s a language that favors being readable, easy to use, and above all, to learn.<p>But in many other languages, the very same operator is often misused as, or confused for, the operator for equality or assignation.<p>We, as a community, didn&#x27;t want people to wonder why there are several ways to do assignation (we have this problem with string templating already). Instead, we wanted to be sure that people could ignore the existence of &quot;:=&quot; for some times during their learning process.<p>And so the decision has been taken to make is very easy to distinguish it from &quot;=&quot; and &quot;==&quot;, forcing parenthesis when necessary to make it clear this is a completely different use case. Also to hint people at using it only when necessary.<p>If you like scripting in Python because it&#x27;s so easy to go from an idea to code, it&#x27;s not random luck. It&#x27;s because the language is a collections of thousands of such decisions.