Skip to content

Commit fe3120a

Browse files
codeandfireFFY00
authored andcommitted
Removed footnote stating that PEP 420 namespace packages are ignored
1 parent 8dceab3 commit fe3120a

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

docs/using.rst

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ If you have a file system layout such as::
3131

3232
then the directories are ``data``, ``data/one``, and ``data/two``. Each of
3333
these are also Python packages by virtue of the fact that they all contain
34-
``__init__.py`` files [#fn1]_. That means that in Python, all of these import
34+
``__init__.py`` files. That means that in Python, all of these import
3535
statements work::
3636

3737
import data
@@ -41,7 +41,7 @@ statements work::
4141
Each import statement gives you a Python *module* corresponding to the
4242
``__init__.py`` file in each of the respective directories. These modules are
4343
packages since packages are just special module instances that have an
44-
additional attribute, namely a ``__path__`` [#fn2]_.
44+
additional attribute, namely a ``__path__`` [#fn1]_.
4545

4646
In this analogy then, resources are just files or directories contained in a
4747
package directory, so
@@ -108,7 +108,7 @@ Packages or package names
108108

109109
All of the ``importlib_resources`` APIs take a *package* as their first
110110
parameter, but this can either be a package name (as a ``str``) or an actual
111-
module object, though the module *must* be a package [#fn3]_. If a string is
111+
module object, though the module *must* be a package [#fn2]_. If a string is
112112
passed in, it must name an importable Python package, and this is first
113113
imported. Thus the above example could also be written as::
114114

@@ -192,18 +192,12 @@ should return a ``TraversableResources`` instance.
192192

193193
.. rubric:: Footnotes
194194

195-
.. [#fn1] We're ignoring `PEP 420
196-
<https://www.python.org/dev/peps/pep-0420/>`_ style namespace
197-
packages, since ``importlib_resources`` does not support resources
198-
within namespace packages. Also, the example assumes that the
199-
parent directory containing ``data/`` is on ``sys.path``.
200-
201-
.. [#fn2] As of `PEP 451 <https://www.python.org/dev/peps/pep-0451/>`_ this
195+
.. [#fn1] As of `PEP 451 <https://www.python.org/dev/peps/pep-0451/>`_ this
202196
information is also available on the module's
203197
``__spec__.submodule_search_locations`` attribute, which will not be
204198
``None`` for packages.
205199
206-
.. [#fn3] Specifically, this means that in Python 2, the module object must
200+
.. [#fn2] Specifically, this means that in Python 2, the module object must
207201
have an ``__path__`` attribute, while in Python 3, the module's
208202
``__spec__.submodule_search_locations`` must not be ``None``.
209203
Otherwise a ``TypeError`` is raised.

0 commit comments

Comments
 (0)