[Python-Dev] API for the new sysconfig module

R. David Murray rdmurray at bitdance.com
Fri Dec 10 22:59:02 CET 2010


On Thu, 09 Dec 2010 16:18:14 -0800, Raymond Hettinger <raymond.hettinger at gmail.com> wrote:
> Does anyone know why this needed a separate module and so many accessor functions?

Originally sysconfig was moved *out* of distutils, and distutils was
changed to use it.  But that proved to be as fragile as many other
distutils changes.  When distutils was reverted, sysconfig was kept
because of the long term desire to move it out of distutils.  At that
point I think it would have been very easy to propose API changes, but I
suppose it didn't occur to anyone to think about that possibility.

> ISTM it mostly could have been reduced to single call returning a nested dictionary.

If what was returned was, as you suggested on IRC, a set of named tuples,
it seems to me that would be a very convenient interface.  And since
all values (as I understand it) are intended to be static (even if some
aren't at the moment), it seems to make sense from an implementation
standpoint as well.

Like Éric, I'm not sure what the implications of the existing module
having been released in 2.7 and 3.2 beta are in terms of making such an
API change.

--
R. David Murray                                      www.bitdance.com


More information about the Python-Dev mailing list