[import *] is bad practice because the code is inefficient because we import everything. Also, we may have clashing names since we import more members than we’re supposed to.
I think it's bad practice because of the second part (name collisions), not really because "importing everything is inefficient."
AFAIK, there is no difference in doing import random and from random import *in terms of performance. It's just a different namespace.
Note that in general the practice of importing * from a module or package is frowned upon, since it often causes poorly readable code. However, it is okay to use it to save typing in interactive sessions.
It doesn't mention performance, only readability.
Rest of the article looks good, though. Thanks for sharing.
I think it's bad practice because of the second part (name collisions), not really because "importing everything is inefficient."
AFAIK, there is no difference in doing
import random
andfrom random import *
in terms of performance. It's just a different namespace.As per the python documentation:
It doesn't mention performance, only readability.
Rest of the article looks good, though. Thanks for sharing.
Thanks. I made the correction.