Eric V. Smith added the comment: To be more clear: the parser takes the longest token that could be valid. Since "n" can't be part of a hex number, parsing stops there, returning "0xaa" as the first token.
So: >>> 0xaaif 1 else 0 170 >>> hex(0xaaif 1 else 0) '0xaa' >>> ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21979> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com