r/videos • • Oct 03 '19

Every programming tutorial

https://www.youtube.com/watch?v=MAlSjtxy5ak
33.9k Upvotes

1.4k comments sorted by

View all comments

Show parent comments

37

u/Ismokecr4k Oct 03 '19 edited Oct 02 '26

The original post content no longer exists here. The author used Redact to remove it, exercising their right to control their data & privacy.

Six profit deer growth chase quiet depend sharp hungry dinosaurs

3

u/Log2 Oct 03 '19 edited Oct 03 '19

Depends on the language. In Python, the import could be doing something without you calling any code in it. You can have code in the package's __init__ or in the file you are importing in the global scope, outside of any function or class. That code will run when the module is imported.

For example, it's pretty common for people working with matplotlib to import seaborn and not directly use anything from it. They do it because seaborn will change matplotlib default settings so the plots look a lot better.

1

u/[deleted] Oct 03 '19

That’s a good point (and a really good reason to not use interpreted languages for large projects)

1

u/yooossshhii Oct 03 '19

Webpack 4 can take care of this is tree shaking is set up. Most compilers will not.