diff --git a/docs/snippets/publicity.rst b/docs/snippets/publicity.rst index dd165a11..332aeae7 100644 --- a/docs/snippets/publicity.rst +++ b/docs/snippets/publicity.rst @@ -27,6 +27,12 @@ a class called ``_Foo`` is considered private. A method ``bar`` in ``_Foo`` is also considered private since its parent is a private class, even though its name does not begin with a single underscore. +Note, a construct's parent is recursively checked upward until we reach a directory +in ``sys.path`` to avoid considering the complete filepath of a module. +For example, consider the module ``/_foo/bar/baz.py``. +If ``PYTHONPATH`` is set to ``/``, then ``baz.py`` is *private*. +If ``PYTHONPATH`` is set to ``/_foo/``, then ``baz.py`` is *public*. + Modules are parsed to look if ``__all__`` is defined. If so, only those top level constructs are considered public. The parser looks for ``__all__`` defined as a literal list or tuple. As the parser doesn't execute the module,