Is there a "wrong" way to use the import function?

A forum for general discussion of the Python programming language.

Is there a "wrong" way to use the import function?

Postby Stosswalkinator » Wed Jul 24, 2013 3:33 am

I was on /r/learnpython the other day and I saw someone comment that you should never use:
Code: Select all
from ____ import *

It kind of confused me because I'm new(ish) to Python and that's how I learned to import when I didn't just import something specific. Doesn't it just import the whole module? Is there a right or wrong way to import (unless, of course, it doesn't work)?
Posts: 1
Joined: Tue Jul 23, 2013 9:43 pm

Re: Is there a "wrong" way to use the import function?

Postby micseydel » Wed Jul 24, 2013 4:20 am

(1) import is a statement, not a function. If this doesn't make sense yet, don't worry, it's not super important but you'll learn it eventually.
Due to the reasons discussed here we will be moving to on October 1, 2016.

This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.
User avatar
Posts: 3000
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

Return to General Discussions

Who is online

Users browsing this forum: No registered users and 9 guests