Skip to content

Update packaging-projects.rst: rephrase first explanation of __init__.py - #1538

Merged
chrysle merged 2 commits into
pypa:mainfrom
wyattscarpenter:patch-1
May 20, 2024
Merged

Update packaging-projects.rst: rephrase first explanation of __init__.py#1538
chrysle merged 2 commits into
pypa:mainfrom
wyattscarpenter:patch-1

Conversation

@wyattscarpenter

@wyattscarpenter wyattscarpenter commented May 3, 2024

Copy link
Copy Markdown
Contributor

I thought the explanation of init.py was kind of confusing, so I have improved it somewhat.


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

@abravalheri

abravalheri commented May 3, 2024

Copy link
Copy Markdown
Contributor

To be honest, that is still a weak reasoning1.

Users can import a directory even if it does not have an __init__.py. Sure, it will not be a "regular" package, it will be a "namespace" package, but the text does not explain what is so great about regular packages and why they are recommended over namespaces.

Footnotes

  1. The original text had weak reasoning. This is not a problem this PR is introducing. In that respect things are more or less the same.

@wyattscarpenter

Copy link
Copy Markdown
Contributor Author

This is true.

On the other hand, I guess most users do want a regular package, and if so then there's some virtue in glossing over the exceptions in this very early guide. (There is at least a footnote to explain what is being glossed over.)

@chrysle
chrysle added this pull request to the merge queue May 20, 2024
Merged via the queue into pypa:main with commit 9d2e58f May 20, 2024
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.

3 participants