10
When you execute
import pygame
the pygame is fully imported and ready to work, no more imports are needed.
Now the question is about this line:
from pygame.locals import *
There are several reasons why this should be used, and a few reasons not to do so.
foo.bar.baz.ClassName.classmethod(), there will be 4 lookups in the namespace, which cost some time. The more such lines in code, the more unnecessary waste of time.from struct import * you can't name your function as pack. So, before use such imports, you should explore the module. What does it contain? What does it import by itself?from foo import * and from bar import * and from baz import *, some variables or constants may be shaded or overwritten. In this example, foo.version is overwritten with bar.version, now named as version. So, foo.checkversion() will not work correctly anymore.The proper way is to import the commonly used functions in explicit form, or make them a quick reference, especially when you do not know the module well.
For example:
from foo.bar.baz impor