# Usage of \_\_all\_\_ in \_\_init\_\_.py

**URL:** <https://discuss.python.org/t/usage-of-all-in-init-py/17936>\
**Category:** Python Help\
**Created:** [August 3, 2022, 10:10am UTC](https://discuss.python.org/t/usage-of-all-in-init-py/17936 "2022-08-03T10:10:58Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![chbndrhnns](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/chbndrhnns/32/6741_2.png) [@chbndrhnns](https://discuss.python.org/u/chbndrhnns)\
**Post date:** [August 3, 2022, 8:01pm UTC](https://discuss.python.org/t/usage-of-all-in-init-py/17936/5 "2022-08-03T20:01:05Z")

</div>

IIRC, exports in Javascript are necessary so that imports work. That’s different in Python, of course.

I also never use wildcard imports.  
Still, I find the idea appealing to define my public API in ` __all__ `.

So, my question becomes:  
Is it safe to assume that ` __all__ ` _can_ be used to declare the public API of a package?

I read @steven.daprano 's answer as a yes.

---

_[View the full topic](https://discuss.python.org/t/usage-of-all-in-init-py/17936)._
