[Distutils] Access to Python config info
Fred L. Drake
Fred L. Drake, Jr." <fdrake@acm.org
Wed, 16 Dec 1998 10:49:47 -0500 (EST)
John Skaller writes:
> 1) does the OS support symbolic or hard links?
import os
hasattr(os, "link")
hasattr(os, "symlink")
> 2) what information is in fstat?
> 3) does the OS supply big/little endian Unicode files?
> 4) What operating system is it? [This is a hard question]
> 5) is os.system available?
hasattr(os, "system")
> 6) What is the size of a Python 'integer' 'float'?
> 7) What is the eol character sequence?
I thought this was in there, but can't recall where.
> 8) is there a 'drive' prefix?
> 9) Can you delete an open file (Yes under Unix, No under NT)
> 10) Is there a stderr and/or stdlog file
> 11) Is there a console at all?
> 12) Is there a compiler available?
> 13) Is this J or C Python?
# true for JPython
sys.platform[:4] == "java"
> It may be the proper place for the answer is not in sys.config,
> but in os. But the os module can compute the answers from
> sys.config.
For most of this, probably so. Recall also that Guido & others
recommend "feature tests" to determine the availability of
functionality rather than having a separate flag to indicate
availability. There are many ways in which this is more reliable and
maintainable, though what we're currently describing as sysconfig
remains pertinant. I would expect sysconfig to be used mostly by
things like distutils and not by typical programs. Hence, it would be
good for os to not import it.
-Fred
--
Fred L. Drake, Jr. <fdrake@acm.org>
Corporation for National Research Initiatives
1895 Preston White Dr. Reston, VA 20191