Author belopolsky
Recipients belopolsky
Date 2010-11-11.04:06:51
SpamBayes Score 4.59299e-05
Marked as misclassified No
Message-id <>
The token module appears to be designed to be used with import *.  In fact it is used this way in the tokenize module.  However it does not define __all__ and as a result, from token import * leaks symbol "main":

>>> import tokenize
>>> tokenize.main.__module__

Attached patch adds token.__all__ and "modernizes" generation of the tok_name dictionary.

I also renamed main to _main because it is hard to imagine that any user code would ever want to use it.
Date User Action Args
2010-11-11 04:08:44belopolskysetrecipients: + belopolsky
2010-11-11 04:08:44belopolskysetmessageid: <>
2010-11-11 04:06:52belopolskylinkissue10386 messages
2010-11-11 04:06:52belopolskycreate