STINNER Victor added the comment: > I would fix this by making tokenize.tok_name a copy. It looks like this > behaviour dates back to 1997 (see revision 1efc4273fdb7).
token.tok_name is part of the Python public API: https://docs.python.org/dev/library/token.html#token.tok_name whereas tokenize.tok_name isn't documented. So I dislike having two disconnected mappings. I prefer to add tokenize tokens directly in Lib/token.py, and then get COMMENT, NL and ENCODING using tok_name.index(). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25324> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com