PEP 427: Make it clear that supported != recommended
This commit is contained in:
parent
26d5c79fb9
commit
dc696d75e9
20
pep-0427.txt
20
pep-0427.txt
|
@ -383,10 +383,22 @@ What's the deal with "purelib" vs. "platlib"?
|
|||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue