This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients Albert-Jan Nijburg, meador.inge, serhiy.storchaka
Date 2017-05-16.16:08:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1494950890.91.0.705066310762.issue30377@psf.upfronthosting.co.za>
In-reply-to
Content
The code is correct, it just can be made cleaner. No need to backport the change to other versions.

The line "if line[pos] in '#\r\n':" looks a kind of optimization. In common case (not a newline and not a comment) there is only one check. The expression "(NL, COMMENT)[line[pos] == '#']" is redundant of course, it can be replaced by just "NL". Note that now the line that yields yield TokenInfo(NL, ...) is almost the same for comments and newlines. If rename nl_pos to pos the same line can be used in both cases.
History
Date User Action Args
2017-05-16 16:08:10serhiy.storchakasetrecipients: + serhiy.storchaka, meador.inge, Albert-Jan Nijburg
2017-05-16 16:08:10serhiy.storchakasetmessageid: <1494950890.91.0.705066310762.issue30377@psf.upfronthosting.co.za>
2017-05-16 16:08:10serhiy.storchakalinkissue30377 messages
2017-05-16 16:08:10serhiy.storchakacreate