Python: `from x import *` not importing everything
Question: I know that `import *` is bad, but I sometimes use it for quick prototyping
when I feel too lazy to type or remember the imports

I am trying the following code:

    
    
    from OpenGL.GL import *
    
    shaders.doSomething()
    

It results in an error: `NameError: global name 'shaders' is not defined'

If I change the imports:

    
    
    from OpenGL.GL import *
    from OpenGL.GL import shaders
    
    shaders.doSomething()
    

The error disappears. Why does `*` not include `shaders`?


Answer: If `shaders` is a submodule and [it’s not included in
`__all__`](http://docs.python.org/3/tutorial/modules.html#importing-from-a-
package), `from … import *` won’t import it.

[And yes, it is a
submodule.](http://pyopengl.sourceforge.net/documentation/pydoc/OpenGL.GL.shaders.html)

