[issue10386] token module should define __all__
report at bugs.python.org
Thu Nov 11 05:08:44 CET 2010
New submission from Alexander Belopolsky <belopolsky at users.sourceforge.net>:
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
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.
components: Library (Lib)
stage: patch review
title: token module should define __all__
versions: Python 3.2
Added file: http://bugs.python.org/file19568/token-all.diff
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list