[Python-Dev] API for the new sysconfig module
raymond.hettinger at gmail.com
Fri Dec 10 21:27:26 CET 2010
On Dec 10, 2010, at 6:20 AM, Éric Araujo wrote:
> Final note: with 3.2 being in beta, I don’t know how much can be changed
Part of the purpose of a beta, and in our case, two betas is to give
people a chance to exercise new APIs and fix them before they
become set in stone two months later.
IMO, sysconfig did not warrant a whole module. The pile of
awkward accessor functions is harder to learn / remember
than the simple data structure shown in the last email.
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()
>>> # the named tuple fields:
['config_vars', 'platform', 'version', 'scheme_names', 'paths']
This would be a straight-forward API that uses existing, well-known
tools (attribute access and dict.get) instead of an unnecessary
nest of ad-hoc accessor functions living in a new module.
Tastes may vary on writing getter functions for every category
of interest but we did not need a whole new module for this.
The referenced email didn't indicate much if any thought about
the API design, so I think should get that thought now.
If those functions were already public in distutils, it is trivial
to write an adapter for them there.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-Dev