News for hackers. Stuff that matters.
Re:In Python, `[0xfor x in (1, 2, 3)]` returns `[15]` by tom_mellior on Wednesday April 14, 2021 @02:26AM (#26803623)
The lexer reads the longest tokens it can (the "maximum munch" rule mentioned in another answer). Once it has read the 0, it has decided to read a number. It will then proceed to read the longest possible number at this position, which is 0xf. This is simpler to specify and implement than the alternative that would require looking ahead to see where to split.

There are no comments on this comment yet.