[Python-Dev] PEP about sys.implementation and implementation specific user site directory

Nick Coghlan ncoghlan at gmail.com
Sat Oct 10 18:23:43 CEST 2009

Michael Foord wrote:
> Why not just sys.implementation as a string? Everything else can
> trivially be deduced from that anyway. What is the use-case for the
> extra information?

I think Christian's set of required attributes is much too large (I
would only have "name" as a required field), but I can understand the
desire to use a structure rather than a simple string.

As with sys.float_info, it gives a new namespace to store "info about
the implementation" without throwing more and more stuff into the main
sys namespace.

So it might start with just "name" being compulsory (since people can
use lower() to iron out any capitalisation issues), but allow
implementation specific attributes to migrate from the sys module to the
implementation namespace.

So "url" might become a common attribute, with each implementation
providing a pointer to their homepage. CPython might decide to put our
eventual Hg based replacement for sys.subversion under
sys.implementation instead of at the module level, etc.

A designated location for "put your implementation specific attributes
here" inside the sys module is a lot less hassle than creating a whole
new module for the purpose, but gives most of the same benefits.


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-Dev mailing list