Skip to content

Commit 2fff101

Browse files
committed
Document Python prior art
Based on this comment: #3243 (comment) THere might be some techncial nuance missing but this should generally get the point that users of a language with close-enough semantics have been wanting this feature that it was added in 2003 and then improved in 2012. I decided to forego the examples as that will be better in the guide-level explanation.
1 parent 42046f8 commit 2fff101

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

text/0000-packages-as-optional-namespaces.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ This proposal is basically the same as https://internals.rust-lang.org/t/pre-rfc
181181

182182
Namespacing has been discussed in https://internals.rust-lang.org/t/namespacing-on-crates-io/8571 , https://internals.rust-lang.org/t/pre-rfc-domains-as-namespaces/8688, https://internals.rust-lang.org/t/pre-rfc-user-namespaces-on-crates-io/12851 , https://internals.rust-lang.org/t/pre-rfc-hyper-minimalist-namespaces-on-crates-io/13041 , https://internals.rust-lang.org/t/blog-post-no-namespaces-in-rust-is-a-feature/13040/4 , https://internals.rust-lang.org/t/crates-io-package-policies/1041/37, https://internals.rust-lang.org/t/crates-io-squatting/8031, and many others.
183183

184+
Python has a similar coupling of top-level namespaces and modules with the filesystem. Users coming from other packaging systems, like Perl, wanted to be able to split up a package under a common namespace. A hook to support this was added in Python 2.3 (see [PEP 402](https://peps.python.org/pep-0402/#the-problem). In [PEP 420](https://peps.python.org/pep-0420/) they formalized a convention for packages to opt-in to sharing a namespace. Differences:
185+
- Python does not have a coupling between package names and top-level namespaces so there is no need for extending the package name format or ability to extend their registry for permissions support.
186+
- In Python, nothing can be in the namespace package while this RFC allows the namespace package to also provide an API.
187+
184188
# Unresolved questions
185189

186190
- How exactly should the Cargo.toml `lib.name` key work in this world, and how does that integrate with `--extern` and `-L` and sysroots?

0 commit comments

Comments
 (0)