3 ms·
Not going to work: >>> x = -3 >>> if x <- 2: ... print 'yes' ... yes >>> x = 5 >>> if x <- 2: ... print 'yes' ...
by kelnos 7y ago
Not going to work:
>>> x = -3
>>> if x <- 2:
... print 'yes'
...
yes
>>> x = 5
>>> if x <- 2:
... print 'yes'
...
>>>
Yes, those are ugly examples of bad use of whitespace, but making '<-' mean assignment would be a backwards-incompatible change.
(In case it isn't clear, that evaluates as "if x is less than negative two".)
- m463 7y agoDidn't C have syntax holes like this? like c=+1 --> c = +1 or c =+ 1
- JoeAltmaier 7y agoOriginally, in version 0. It was quickly changed to c += 1 to fix that.