+ 1
(Python) Why importing only one "part" when we can import all ?, how does this affect the code ?
I was looking for some codes and I'm just wandering, since I'm learning Python I want to know, how bigger is the difference from example: Import abc.def Import abc From abc Import * I know that the first one Import just the part that you want and the last one Import everything but, how is that used ?, why don't just import everything?.
2 Respuestas
+ 5
importing only parts of a modul / library is done to keep memory consumption low. There are large modules and if you only need one function or method from it, it's a good practice to only import the once you need.
+ 1
thanks :)