Gareth Rees added the comment: A third alternative:
3. Add a method whose effect is to consume comments and whitespace, but which does not yield a token. You could then call this method, and then look at shlex.lineno, which will be the line number of the first character of the next token (if there is a next token). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue24869> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com