New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prefix search is filesystem-centric #41525
Comments
With the introduction of zipimport I experimented to I discovered that I could entirely remove the standard
With the move towards esoteric import mechanisms it Should some import hook API be available to determine |
Is this request still relevant for 3.2? |
Personally I think it's just as relevant as it always was, particularly with the introduction of importlib, but Brett will have a more informed opinion. I won't be surprised if this issue is closed as wontfix. |
Yeah, I'm pretty sure the bootstrap mechanism needs to be able to get hold of os.py directly so it can be injected into the importlib._bootstrap namespace. However, it may be worth figuring out and documenting the bare minimum that has to exist on the filesystem in order for importlib to get going. It's even possible that Brett freezes enough into the interpreter binary that the required set has shrunk to zero. |
Importlib actually requires no files from disk; everything that is required for importlib are built-in modules or are constants in importlib itself (e.g. os.sep). So technically this should be doable since my bootstrap work freezes importlib itself. |
Is this something that we could get into 3.5? |
How much smaller would the stdlib for 3.5 become if you compress it with zip? |
What about the performance penalty for zipping stdlib? is it significant? When would you like to zip stdlib? For embedded systems with limited disk Patrik Iselind On Sat, Dec 24, 2016 at 6:34 PM, Patrik Iselind <report@bugs.python.org>
|
Originally zip file importing was faster than standard importing from disk because of the fewer stat calls, but importlib caches such things so I don't know if it's still beneficial. As for space savings, I have no idea; you can try zipping the files yourself to find out the space savings. |
Is it enough to include everything in the Lib folder, excluding Patrik Iselind Den 2016-12-25 kl. 17:31, skrev Brett Cannon:
|
Don't forget that the built-in modules may need to be available before the S Steve Holden On Sun, Dec 25, 2016 at 5:48 PM, Patrik Iselind <report@bugs.python.org>
|
Note that Steve Dower made some significant changes to sys.path initialisation on Windows in Python 3.6 that could potentially be generalised to other platforms: https://docs.python.org/3/using/windows.html#finding-modules (There's nothing inherently Windows specific about them, they're mainly useful for the case of embedding CPython inside a larger application) One of those was to allow pythonXY.zip to be used as a sentinel indicating the location of PYTHONHOME. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: