3 ms·
Please never use `from something import *`, not even for a demo. It is not explicit, not maintainable, and goes against all Python guidelines. Certainly never e
by OutOfHere 9mo ago
Please never use `from something import *`, not even for a demo. It is not explicit, not maintainable, and goes against all Python guidelines. Certainly never expect any user to use it either.
- cl3misch 9mo agoFWIW the afaik most common symbolic math Python library sympy does that on the first page of their tutorial. I think in this space it's pretty common. https://docs.sympy.org/latest/tutorials/intro-tutorial/intro.html https://docs.sympy.org/latest/tutorials/intro-tutorial/intro... I have to admit that I still like to use the ancient from pylab import * in scripts that only I will ever see. It makes it so much easier to use numpy in a "tool of thought" way. I would never do this in a library, though.
- OutOfHere 9mo agoTwo wrongs don't make a right. It risks significant ambiguity in longer snippets or files, and is therefore bad practice.
- marcelbundle 9mo agoYou would be suprised on how many large scale project I saw this beauty lamao, not saying that this is okay, people just dgaf
- dinunnob 9mo agoYeah, you’re not wrong. Makes the syntax a bit annoying here (goal was to lower barrier of entry for physicists). I agree this is bad practice.
- OutOfHere 9mo agoIn the limiting sense, especially when a user mixes your snippet with snippets from other packages, the barrier of entry becomes greater due to the resolution ambiguity, not less.
- dinunnob 9mo agofixed in the readme. thanks - while we are talking imports ... how did `import pyspark.sql.functions as F` ever get past the pep police