[Python-checkins] r69187 - peps/trunk/pep-0366.txt
nick.coghlan
python-checkins at python.org
Sun Feb 1 14:01:16 CET 2009
Author: nick.coghlan
Date: Sun Feb 1 14:01:16 2009
New Revision: 69187
Log:
Add explicit note regarding __package__ in top level modules
Modified:
peps/trunk/pep-0366.txt
Modified: peps/trunk/pep-0366.txt
==============================================================================
--- peps/trunk/pep-0366.txt (original)
+++ peps/trunk/pep-0366.txt Sun Feb 1 14:01:16 2009
@@ -72,6 +72,12 @@
manually. It has the advantage that this change need only be made
once per file, regardless of the number of relative imports.
+Note that setting ``__package__`` to the empty string explicitly is
+permitted, and has the effect of disabling all relative imports from
+that module (since the import machinery will consider it to be a
+top level module in that case). This means that tools like ``runpy``
+do not need to provide special case handling for top level modules
+when setting ``__package__``.
Rationale for Change
====================
More information about the Python-checkins
mailing list