On Thu, Jul 5, 2018 at 10:10 PM Tim Peters <tim.pet...@gmail.com> wrote:
> .. > 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). So assignment and equality-testing in C code look > entirely different to me, regardless of context. > > 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. > Python really has a strong C legacy and this is the area where I agree that C designers made a mistake by picking a symmetric symbol (=) for an asymmetric operation. On top of that, they picked an asymmetric digraph (!=) for a symmetric operation as well and Python (unfortunately) followed the crowd and ditched a much better alternative (<>). My only hope is that Python 4.0 will allow ← to be used in place of either = or :=. :-)
_______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com