Intermediate Python
Q56 / 101

What is the purpose of __all__ in a Python module?

Correct! Well done.

Incorrect.

The correct answer is A) Defines which names are exported with "from module import *"

A

Correct Answer

Defines which names are exported with "from module import *"

Explanation

__all__ = ["ClassA", "func_b"] controls what from module import * imports. Without it, all names not starting with _ are exported.

Progress
56/101