3 ms·
Anyone know why it's legal to use logic operators like that in Python? That is, 0or, 0xor, 0and,etc. in my view, this should clearly be a syntax error. edit:
by TrackerFF 6y ago
Anyone know why it's legal to use logic operators like that in Python?
That is, 0or, 0xor, 0and,etc. in my view, this should clearly be a syntax error.
edit: as noted by the parent comment, 0xor != 0 xor, but 0x or. But this seems to hold true for all data types.
- deleted 6y ago[deleted]
- mywittyname 6y agoOther languages don't enforce whitespace around logical operators. Like `0xf||1+2` is perfectly valid javascript. I can see how this could slip by, it's possible that original python used a non-alphabetical token as the logical operator, then it was swapped out at some later time for or and and.