File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,27 @@ example could also be written as::
122
122
eml = files(email.tests.data).joinpath('message.eml').read_text()
123
123
124
124
125
+ Namespace Packages
126
+ ==================
127
+
128
+ ``importlib_resources `` supports namespace packages as anchors just like
129
+ any other package. Similar to modules in a namespace package,
130
+ resources in a namespace package are not allowed to collide by name.
131
+ For example, if two packages both expose ``nspkg/data/foo.txt ``, those
132
+ resources are unsupported by this library. The package will also likely
133
+ experience problems due to the collision with installers.
134
+
135
+ It's perfectly valid, however, for two packages to present different resources
136
+ in the same namespace package, regular package, or subdirectory.
137
+ For example, one package could expose ``nspkg/data/foo.txt `` and another
138
+ expose ``nspkg/data/bar.txt `` and those two packages could be installed
139
+ into separate paths, and the resources should be queryable::
140
+
141
+ data = importlib_resources.files('nspkg').joinpath('data')
142
+ data.joinpath('foo.txt').read_text()
143
+ data.joinpath('bar.txt').read_text()
144
+
145
+
125
146
File system or zip file
126
147
=======================
127
148
You can’t perform that action at this time.
0 commit comments