Hacker News new | ask | show | jobs
by kyran_adept 2116 days ago
Not having _all_ is just part of the problem. With "import *" you also unknowingly load and potentially overwrite symbols. If you specify each symbol you use, it's very simple for even the most basic linter to figure you are doing something wrong.
2 comments

Even beyond that, if you've imported `from foo import bar` and then `from something import *`, it might work just fine. Then you upgrade the `something` module, and it happens to now include an item named `bar`, and you're suddenly breaking your existing usage without ever having changed your code.

Star imports are convenient, but dangerous in so many subtle ways. There's a very good reason that every major Python linter will call this out as bad behavior.

It's not unknowingly at all.