On Sat, Apr 28, 2012 at 7:39 PM, Victor Stinner email@example.com wrote:
I've written up a PEP for the sys.implementation idea. Feedback is welcome!
Cool, it's better with PEP! Even the change looks trivial.
name the name of the implementation (case sensitive).
It would help if the PEP (and the documentation of sys.implementation) lists at least the most common names. I suppose that we would have something like: "CPython", "PyPy", "Jython", "IronPython".
Good point. I'll do that.
version the version of the implementation, as opposed to the version of the language it implements. This would use a standard format, similar to ``sys.version_info`` (see `Version Format`_).
Dummy question: what is sys.version/sys.version_info? The version of the implementation or the version of the Python lnaguage? The PEP should explain that, and maybe also the documentation of sys.implementation.version (something like "use sys.version_info to get the version of the Python language").
Yeah, sys.version (et al.) is the version of the language. It just happens to be the same as the implementation version for CPython. I'll make that more clear.
Why not adding this information to the imp module?
This is certainly something I need to clarify. Either the different implementors set these values in the various modules to which they pertain; or they set them all in one place (sys.implementation). I really think we should avoid having a mix.
In my mind sys.implementation makes more sense. For example, in the case of cache_tag (which is merely a potential future variable), its value is an implementation detail used by importlib. Having it in sys.implementation would emphasize this point.