# Why is \`using Module\` used in Julia while \`from module import \*\` is generally discouraged in Python?

**URL:** <https://discourse.julialang.org/t/why-is-using-module-used-in-julia-while-from-module-import-is-generally-discouraged-in-python/8479>\
**Category:** New to Julia\
**Tags:** question, module\
**Created:** [January 19, 2018, 4:24pm UTC](https://discourse.julialang.org/t/why-is-using-module-used-in-julia-while-from-module-import-is-generally-discouraged-in-python/8479 "2018-01-19T16:24:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![airpmb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/airpmb/32/7826_2.png) [@airpmb](https://discourse.julialang.org/u/airpmb)\
**Post date:** [January 19, 2018, 4:24pm UTC](https://discourse.julialang.org/t/why-is-using-module-used-in-julia-while-from-module-import-is-generally-discouraged-in-python/8479/1 "2018-01-19T16:24:12Z")

</div>

There’s probably a subtle difference in the functionality but to me `using Module` in Julia and `from module import *` in Python accomplish basically the same thing. In Python wildcard imports are discouraged [[PEP8](http://legacy.python.org/dev/peps/pep-0008/#imports)]; PEP8 states:

> Wildcard imports (from import \*) should be avoided, as they make it unclear which names are present in the namespace, confusing both readers and many automated tools

Wouldn’t the same rationale apply to Julia code? I don’t see anything in the Julia Style Guide that provides any guidance on this. A properly-configured IDE can of course show you where a symbol in a given source file comes from, but that’s true in both languages as well.

---

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [January 19, 2018, 4:42pm UTC](https://discourse.julialang.org/t/why-is-using-module-used-in-julia-while-from-module-import-is-generally-discouraged-in-python/8479/2 "2018-01-19T16:42:24Z")

</div>

There are two issues with `from foo import *` in Python:

1. It makes it hard to figure out where the imported names came from
2. It can potentially clobber existing names in your module or names from other modules you’ve imported

Issue (1) does apply, as you’ve noted, in Julia, but issue (2) does not. Doing `using Foo` will _not_ clobber any of your existing types or functions (it will just require you to be specific and refer to any conflicting types as `Foo.MyType` instead of just `MyType`). For that reason, `using Foo` is less harmful than `from foo import *` in Python.

But I do agree that the convenience of `using Foo` should be balanced against the increased difficulty in reasoning about a piece of code. I generally try to avoid multiple plain `using` declarations in a given module, and instead try to prefer `using Foo: my_method` when I only need one or two names from a given module.
