Practice mode Python

What makes a directory a regular Python package?

Correct answer D. It contains an __init__.py file

Explanation

A regular package is a directory containing an __init__.py file, which runs when the package is first imported and can be empty. Since Python 3.3, directories without it can still be imported as namespace packages, but __init__.py is what defines a regular package. setup.py concerns distribution, not importing.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.