[Python-Dev] API for the new sysconfig module (original) (raw)

Antoine Pitrou solipsis at pitrou.net
Fri Dec 10 21:56:00 CET 2010


On Fri, 10 Dec 2010 12:27:26 -0800 Raymond Hettinger <raymond.hettinger at gmail.com> wrote:

IMO, sysconfig did not warrant a whole module.

Where would you put it?

Rather than using two levels of dictionary, it's also possible to use a named tuple if you think that is more clean looking:

>>> c = sys.sysconfig() >>> c.configvars.get('SO) '.pyd'

Some of these things are computed at runtime by parsing makefiles and other stuff. You don't want to do it as soon as the module is imported. There may also be some bootstrap issues when importing some of the necessary modules from the top level.

The current API is fine IMO. Perhaps it could be refined a bit, but there's nothing horrendous. It's not for everyone to use; creating dict-like classes over these APIs would be a terrible waste of time, and add a useless maintenance burden.

If those functions were already public in distutils, it is trivial to write an adapter for them there.

The whole point was to separate them from distutils.

Regards

Antoine.



More information about the Python-Dev mailing list