Why is it parsed like that and not as invalid integer literal "0xfor"?
edit: 'cause it's a bug! https://bugs.python.org/issue43833
edit: 'cause it's a bug! https://bugs.python.org/issue43833
The question is whether "0xfor" is a valid way to represent the two tokens "0xf", "or". My reading of the rules is that it isn't, and that whitespace is required.
The rule, which I initially misinterpreted, is:
> Whitespace is needed between two tokens only if their concatenation could otherwise be interpreted as a different token (e.g., ab is one token, but a b is two tokens).
Since "0xfor" cannot be interpreted as a different (single) token, whitespace is not needed.
(I'm not a fan of this particular consequence of that rule, and I suspect it was not intended, but it says what it says.)