[Python-checkins] peps: PEP 427: Make it clear that supported != recommended

nick.coghlan python-checkins at python.org
Wed Jan 29 14:06:54 CET 2014


http://hg.python.org/peps/rev/301db11cbb48
changeset:   5365:301db11cbb48
user:        Nick Coghlan <ncoghlan at gmail.com>
date:        Wed Jan 29 23:06:29 2014 +1000
summary:
  PEP 427: Make it clear that supported != recommended

files:
  pep-0427.txt |  20 ++++++++++++++++----
  1 files changed, 16 insertions(+), 4 deletions(-)


diff --git a/pep-0427.txt b/pep-0427.txt
--- a/pep-0427.txt
+++ b/pep-0427.txt
@@ -383,10 +383,22 @@
 
 Is it possible to import Python code directly from a wheel file?
     Yes, the wheel format is deliberately designed to be compatible with
-    Python's support for importing from zip files. While not all wheels
-    will support being used that way (for example, if they include C
-    extensions), most pure Python wheels can be used that way just by
-    placing their name on ``sys.path``.
+    Python's support for importing from zip files, ensuring that it
+    provides a superset of the functionality provided by the preceding
+    egg format.
+
+    However, this is generally not a *recommended* approach to using wheel
+    files, as importing from a zip file rather than an ordinary filesystem
+    directory imposes a number of additional constraints that will often
+    break the assumptions of Python developers (for example, C extensions
+    cannot be imported directly from a zip archive, and the ``__file__``
+    attribute no longer refers to an ordinary filesystem path, but to
+    a combination path that includes both the location of the zip archive
+    on the filesystem and the relative path to the module inside the
+    archive).
+
+    Like metaclasses and metapath importers, if you're not sure if you need
+    to take advantage of this feature, you almost certainly don't need it.
 
 
 References

-- 
Repository URL: http://hg.python.org/peps


More information about the Python-checkins mailing list