[Python-Dev] First draft of "sysconfig"

Tarek Ziadé ziade.tarek at gmail.com
Thu Dec 17 10:55:52 CET 2009


On Tue, Dec 15, 2009 at 6:59 PM, Dino Viehland <dinov at microsoft.com> wrote:
> Tarek wrote:
>> How would you use it when a list is returned ? Can you provide a few
>> examples where
>> the code wants to know the default architecture for the current platform ?
>> etc.
>
> The consumer could enumerate over it and then do whatever they were doing
> w/ the platform multiple times.  If an earlier one succeeds at what
> they're attempting to do then they're done.  If there's no "success", lets
> say they're appending something to sys.path, then they'd do it for all
> elements in the sequence.

get_platform is currently used 1/ by Distutils' build command to
define the default platform name
to build from (and there's an option to override it : --plat-name), 2/
by site.py to add the build dir of Python in case we are running from
it.

For 1/, build allows cross-platform building only if the user is under
windows, otherwise
it'll throw an error.  IOW, this api is used to know what is the
*current* platform, even if there are some (tiny) ways to work for
"other" platforms.  2/ was meant to be dropped at some point (see
http://bugs.python.org/issue586680) and very CPython specific I guess.

I am not sure, but in Jython/IronPython, do you guys have a "default"
platform ?
if so, returning that default in get_platform() would work.

> It's not an absolute requirement or anything like that - it just jumped
> out at me because IronPython and Jython do have multiple platforms
> which could be relevant at one time.

Sure, and that's why I have asked feedback from IrontPython/Jython people,
Thanks for that.

Regards
Tarek

-- 
Tarek Ziadé | http://ziade.org


More information about the Python-Dev mailing list