summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2002-10-22 21:00:44 (GMT)
committerFred Drake <fdrake@acm.org>2002-10-22 21:00:44 (GMT)
commit55803bca98257d825cc9b4280164e5fc46a37706 (patch)
tree030d62daf6cdde3de43d80562937a3813918c469
parentd6cf8bea0a5d0718825c7eee13bb27af2c04da99 (diff)
downloadcpython-55803bca98257d825cc9b4280164e5fc46a37706.zip
cpython-55803bca98257d825cc9b4280164e5fc46a37706.tar.gz
cpython-55803bca98257d825cc9b4280164e5fc46a37706.tar.bz2
Describe __path__ along with the rest of the package description.
Closes SF bug #626554.
-rw-r--r--Doc/tut/tut.tex13
1 files changed, 12 insertions, 1 deletions
diff --git a/Doc/tut/tut.tex b/Doc/tut/tut.tex
index 41d7e33..18e26e4 100644
--- a/Doc/tut/tut.tex
+++ b/Doc/tut/tut.tex
@@ -2672,7 +2672,7 @@ current namespace because they are defined in the
\module{Sound.Effects} package when the \code{from...import} statement
is executed. (This also works when \code{__all__} is defined.)
-Note that in general the practicing of importing * from a module or
+Note that in general the practice of importing \code{*} from a module or
package is frowned upon, since it often causes poorly readable code.
However, it is okay to use it to save typing in interactive sessions,
and certain modules are designed to export only names that follow
@@ -2713,6 +2713,17 @@ Sound.Effects import echo}.
%because of its awkwardness; since most packages will have a relative
%shallow substructure, this is no big loss.)
+\subsection{Packages in Multiple Directories}
+
+Packages support one more special attribute, \member{__path__}. This
+is initialized to be a list containing the name of the directory
+holding the package's \file{__init__.py} before the code in that file
+is executed. This variable can be modified; doing so affects future
+searches for modules and subpackages contained in the package.
+
+While this feature is not often needed, it can be used to extend the
+set of modules found in a package.
+
\chapter{Input and Output \label{io}}