[Python-Dev] First draft of "sysconfig"

Dino Viehland dinov at microsoft.com
Tue Dec 15 01:11:26 CET 2009

Antoine wrote:
> Dino Viehland <dinov <at> microsoft.com> writes:
> >
> > > * get_platform():  Return a string that identifies the current
> > > platform. (this one is used by site.py for example)
> >
> > I wonder if this would make more sense a built-in.  Ultimately it seems
> > like the interpreter implementation knows best about what aspects of
> > it's underlying platform would require different libraries.
> I don't think it makes sense to make a builtin of such a little used,
> non-performance critical API.
> If we want to factor out all implementation-specific things, we could add a
> module dedicated to that (e.g. "_interpreter") and have other modules (os,
> platform, sysconfig...) draw from that.

Putting this in an _interpreter module is fine with me (or even putting
it somewhere in sys works - e.g. there was a sys.implementation discussion
not too long ago).  The important thing is that the interpreter
implementation really is the one that understands what binaries they
would be compatible with it regardless of how often it gets used and
how it performs.

If it's not a built-in then I think we'd be in a world where either every
implementation needs to patch this file in their distribution or contribute
a change back to support their implementation and that just seems ugly. And
it's already a very large function even w/o IronPython, Jython, PyPy and
Unladen Swallow support.

More information about the Python-Dev mailing list