# In what order are \`\_\_init\_\_\` functions called?

**URL:** <https://discourse.julialang.org/t/in-what-order-are-init-functions-called/60492>\
**Category:** General Usage\
**Tags:** module\
**Created:** [May 4, 2021, 1:38am UTC](https://discourse.julialang.org/t/in-what-order-are-init-functions-called/60492 "2021-05-04T01:38:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Krastanov](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/krastanov/32/6817_2.png) [@Krastanov](https://discourse.julialang.org/u/Krastanov)\
**Post date:** [May 4, 2021, 1:38am UTC](https://discourse.julialang.org/t/in-what-order-are-init-functions-called/60492/1 "2021-05-04T01:38:29Z")

</div>

If a module C contains

```julia
using A
using B

```

I know that `C. __init__ ` is called last. But is there any promise about the order of `A. __init__ ` and `B. __init__ `?

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [May 4, 2021, 7:52am UTC](https://discourse.julialang.org/t/in-what-order-are-init-functions-called/60492/2 "2021-05-04T07:52:05Z")

</div>

It may currently happen in that order if `A` does not itself use `B` somewhere down the line, but I don’t think this is a guaranteed feature of the API so it may not be good design to rely on it. Cf this discussion

[https://github.com/JuliaLang/julia/issues/36090](https://github.com/JuliaLang/julia/issues/36090)
