Simple Modules Question

Justin Sheehy dworkin at
Thu Apr 27 18:11:30 EDT 2000

"Akira Kiyomiya" <akira.kiyomiya at> writes:

> from string import atoi    # imports 'string'
>                                      # places atoi in current namespace

That comment is incorrect.  This statement gets atoi from string into
the current namespace, but does not really import string.

Unless you are using the interactive interpreter or are using one of
the very few modules designed for 'from module import *', you
shouldn't use that.  Do 'import module' and use full names of module
members instead.



More information about the Python-list mailing list