Simple Modules Question

Justin Sheehy dworkin at ccs.neu.edu
Fri Apr 28 00:11:30 CEST 2000


"Akira Kiyomiya" <akira.kiyomiya at autodesk.com> 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.

-Justin

 




More information about the Python-list mailing list