Repository navigation
docs: clarify packaging tutorial scope and import behavior - #16
Open
harshitethic wants to merge 1 commit into
Open
harshitethic wants to merge 1 commit into
harshitethic wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses pypa#614.
The tutorial currently creates an empty
__init__.pyand definesadd_oneinexample.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:
__init__.pydoes not re-exportadd_one;from ... import exampleusage at the point where the function is introduced;__init__.pyis 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/