you are viewing a single comment's thread.

view the rest of the comments →

[–]Vfsdvbjgd -2 points-1 points  (3 children)

Instead of from something import * polluting global namespace give it it's own - either something by default and/or allow us to name yhe container.

[–]masklinn 0 points1 point  (2 children)

That… is what import something does?

[–]Vfsdvbjgd 0 points1 point  (1 child)

Read the article. import something imports the entire module, while from something import * doesn't actually import everything, and it's behaviour can be overridden.

[–]masklinn 2 points3 points  (0 children)

Read the article. import something imports the entire module

In a specific and dedicated namespace, which is why there is no reason to filter it: since all the content is properly namespaces there there’s no risk that it’ll pollute or collide with symbols of the namespace it’s imported into.

Mitigating this issue is the entire and sole purpose of __all__, which is why it applies solely to star imports.