Guido van Rossum <guido@python.org> writes: >> Playing tricks with the contents of pkg.__path__ apparently has its >> uses, > > It's the *defined* API for adding to the set of locations from which > submodules and subpackages of a package are to be loaded. You can't > just call that "playing tricks." This is entirely true. I think the key issue for import hooks is whether application code is entitled to make assumptions about what the system puts onto pkg.__path__ before __init__.py gets control. But the writer of __init__.py knows how the package is being packaged, and hence what import hook is responsible for setting up __path__. So it can be coded appropriately. The mistake here is in assuming that arbitrary code can be transparently zipped (or stored in another way, using an import hook) and still work. Some (most) code can, but not all. > Of course. If you freeze code, you have to make sure that it will be > able to find its data files in some other way. But not all code has > to be freezable. This agrees with what I just said (with "freeze" replaced by "zip" or whatever). Paul -- This signature intentionally left blank
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4