Author belopolsky
Recipients belopolsky
Date 2010-11-11.04:06:51
SpamBayes Score 4.59299e-05
Marked as misclassified No
Message-id <1289448524.33.0.684332419929.issue10386@psf.upfronthosting.co.za>
In-reply-to
Content
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__
'token'

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.
History
Date User Action Args
2010-11-11 04:08:44belopolskysetrecipients: + belopolsky
2010-11-11 04:08:44belopolskysetmessageid: <1289448524.33.0.684332419929.issue10386@psf.upfronthosting.co.za>
2010-11-11 04:06:52belopolskylinkissue10386 messages
2010-11-11 04:06:52belopolskycreate