[Python-ideas] PEP 4XX: Adding sys.implementation
Nick Coghlan
ncoghlan at gmail.com
Thu May 3 08:06:44 CEST 2012
On Thu, May 3, 2012 at 1:49 PM, Steven D'Aprano <steve at pearwood.info> wrote:
> I am still unclear what justification there is for having a separate
> sys.version (from PEP 421: "the version of the Python language") and
> sys.implementation.version ("the version of the Python implementation").
> Under what circumstances will one change but not the other?
The PyPy example is the real motivator. It allows "sys.version" to
declare what version of Python the implementation intends to
implement, while sys.implementation.version may be completely
different.
For example, a new implementation might declare sys.version_info as
(3, 3, etc...) to indicate they're aiming at 3.3 compatibility, while
setting sys.implementation.version to (0, 1, etc...) to reflect its
actual immaturity as an implementation.
Implementations are of course free to set the two numbers in lock
step, and CPython, IronPython and Jython will likely continue to do
exactly that.
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-ideas
mailing list