2 ms·
Here's my advice about the most important thing Python does: >>> if x = y: File "<stdin>", line 1 if x = y: ^ SyntaxError: i
by earthboundkid 18y ago
Here's my advice about the most important thing Python does:
>>> if x = y:
File "<stdin>", line 1
if x = y:
^
SyntaxError: invalid syntax
Why is this important? Because it's such a damnably subtle bug. But what if people want to do something like if r = get_result(): r.do_something()? Make them write if r with r as get_result(): r.do_something() instead.