]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Describe __path__ along with the rest of the package description.
authorFred Drake <fdrake@acm.org>
Tue, 22 Oct 2002 21:00:44 +0000 (21:00 +0000)
committerFred Drake <fdrake@acm.org>
Tue, 22 Oct 2002 21:00:44 +0000 (21:00 +0000)
Closes SF bug #626554.

Doc/tut/tut.tex

index 41d7e33478814b3e733ea86b4a2628946fa0a772..18e26e4f3f46fa859cfaa5c168d1595628e992a3 100644 (file)
@@ -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}}