-
-
Notifications
You must be signed in to change notification settings - Fork 31k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doc: update term "namespace package" #129251
base: main
Are you sure you want to change the base?
Conversation
Recommend using regular package officially to avoid people just think `__init__.py` is not necessary.
Another example of namespace pacakge being misunderstood. |
and specifically are not like a :term:`regular package` because they | ||
have no ``__init__.py`` file. | ||
|
||
Namespace packages allow you to split single package across multiple directories or distributions. | ||
On the other hand, namespace packages have some drawbacks and pitfalls. | ||
Use :term:`regular package` always when it fits your needs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use :term:`regular package` always when it fits your needs. | |
It is recommended to use a :term:`regular package` when possible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does "When possible" and "fits your needs" have same nuance?
For example, user who are thinking splitting their packages to two distribution, but it is "possible" to keep releasing one distribution.
In this case, regular package is not fits their need, but it is possible to use regular package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suggested edit makes text less direct, which is the style wanted for our docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I think the wording should be improved. «always» seems strong but is weakened by «when it fits your needs» – people may not now if they do need to split a project!
Also, «across multiple directories» is talking about source trees but «across multiple distributions» is a concern for packaging and installation, so they’re not on the same level.
I’ll think on this and suggest edits!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, it is friendlier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You misunderstand – I meant that the previous wording was more direct, which is what we want. «It is recommended» is not an improvement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For context, @StanFromIreland, Open telemetry is an example of a namespace package.
I recommend removing "On the other hand ... your needs." This is a glossary entry so the prose should be brief and direct. I think if you add @methane's suggestion Namespace packages allow several individually installable packages to have a common parent package., then there is no need for the two sentences and they can be removed.
Co-authored-by: Stan Ulbrych <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops message didn’t post earlier
and specifically are not like a :term:`regular package` because they | ||
have no ``__init__.py`` file. | ||
|
||
Namespace packages allow you to split single package across multiple directories or distributions. | ||
On the other hand, namespace packages have some drawbacks and pitfalls. | ||
Use :term:`regular package` always when it fits your needs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I think the wording should be improved. «always» seems strong but is weakened by «when it fits your needs» – people may not now if they do need to split a project!
Also, «across multiple directories» is talking about source trees but «across multiple distributions» is a concern for packaging and installation, so they’re not on the same level.
I’ll think on this and suggest edits!
5002745
to
16d5407
Compare
How about this?
Both of In case of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @methane. I recommend removing the awkward sentences at the end.
and specifically are not like a :term:`regular package` because they | ||
have no ``__init__.py`` file. | ||
|
||
Namespace packages allow you to split single package across multiple directories or distributions. | ||
On the other hand, namespace packages have some drawbacks and pitfalls. | ||
Use :term:`regular package` always when it fits your needs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For context, @StanFromIreland, Open telemetry is an example of a namespace package.
I recommend removing "On the other hand ... your needs." This is a glossary entry so the prose should be brief and direct. I think if you add @methane's suggestion Namespace packages allow several individually installable packages to have a common parent package., then there is no need for the two sentences and they can be removed.
@willingc I would like to add a sentence to the official documentation to debunk the misconception that #113209 added We have namespace packages section in the reference. But tutorial refers to glossary, not reference. That is why I added the awkward sentences at the end. |
Recommend using regular package officially to avoid people just think
__init__.py
is not necessary.For example: https://stackoverflow.com/questions/448271/what-is-init-py-for
📚 Documentation preview 📚: https://cpython-previews--129251.org.readthedocs.build/