Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
55803bca
Commit
55803bca
authored
Oct 22, 2002
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Describe __path__ along with the rest of the package description.
Closes SF bug #626554.
parent
d6cf8bea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
Doc/tut/tut.tex
Doc/tut/tut.tex
+12
-1
No files found.
Doc/tut/tut.tex
View file @
55803bca
...
...
@@ -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 practic
ing of importing *
from a module or
Note that in general the practic
e 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
}}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment