[Python-Dev] API for the new sysconfig module
Raymond Hettinger
raymond.hettinger at gmail.com
Fri Dec 10 22:35:03 CET 2010
On Dec 10, 2010, at 12:56 PM, Antoine Pitrou wrote:
> 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?
A single function in the sys module.
>
>> 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.config_vars.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.
The proposal is for a function that does the computation when invoked,
not when imported. The function returns a named tuple so that we can
use Python's builtin accessors like attributes and dict.get().
Raymond
More information about the Python-Dev
mailing list