On Fri, Jan 8, 2010 at 2:39 PM, Rob Cherry <[email protected]> wrote: > Extending on this advice somewhat - is it *ever* correct to "import foobar". > > There are countless examples of > > import os,sys > > etc,etc. Strictly speaking should we always be using "from" to only > get what we know we need?
No, the plain import is fine. import sys adds just the single name 'sys' to your global namespace, you then have to access the items in it via sys.version, etc. from sys import version imports just the name 'version' into your global namespace. Kent _______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
