Skip to content

docs: clarify packaging tutorial scope and import behavior - #16

Open
harshitethic wants to merge 1 commit into
mainfrom
docs/614-clarify-packaging-tutorial-scope
Open

harshitethic wants to merge 1 commit into
mainfrom
docs/614-clarify-packaging-tutorial-scope

Conversation

@harshitethic

@harshitethic harshitethic commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Addresses pypa#614.

The tutorial currently creates an empty __init__.py and defines add_one in example.py, but it does not explain up front that the example is teaching an importable package rather than how to expose a command-line executable. That leaves two common beginner expectations unresolved.

This change:

  • states that the tutorial's example is an importable Python package;
  • points command-line application authors to the dedicated command-line tools guide and explains that the build/publish steps still apply afterwards;
  • explains that an empty __init__.py does not re-export add_one;
  • shows the correct from ... import example usage at the point where the function is introduced;
  • notes that re-exporting names from __init__.py is an API-design choice, not a packaging requirement.

This keeps the tutorial's package layout unchanged while removing the ambiguity that led users to expect example_package.add_one() to exist.


📚 Documentation preview 📚: https://python-packaging-user-guide--16.org.readthedocs.build/en/16/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant