[Python-Dev] a new type for sys.implementation (original) (raw)
Nick Coghlan ncoghlan at gmail.com
Fri Jun 1 13:30:43 CEST 2012
- Previous message: [Python-Dev] a new type for sys.implementation
- Next message: [Python-Dev] a new type for sys.implementation
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Fri, Jun 1, 2012 at 7:16 PM, Maciej Fijalkowski <fijall at gmail.com> wrote:
sys.implementation could be added by site or some other startup file.
Yes, why not do that instead of a new thing in C? I don't care about PyPy actually (since we kind of have to implement sys.implementation in python/RPython anyway, since it'll be different)
The idea is that sys.implementation is the way some interpreter internal details are exposed to the Python layer, thus it needs to handled in the implementation language, and explicitly not in Python (if it's in Python, then the implementation has to come up with some other API for accessing those internals from Python code, thus missing a large part of the point of the exercise).
Another question (might be out of topic here). What we do in PyPy to avoid bootstrapping issues (since we have quite a bit implemented in Python, rather than RPython) is to "freeze" the bytecode at compile time (or make time) and put it in the executable. This avoids all sort of filesystem access issues, but might be slightly too complicated.
Yeah, we're already doing that for importlib._bootstrap. It's a PITA (especially when changing the compiler), and certainly not easier than just writing some C code for a component that's explicitly defined as being implementation specific.
Cheers, Nick.
-- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
- Previous message: [Python-Dev] a new type for sys.implementation
- Next message: [Python-Dev] a new type for sys.implementation
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]