[Python-Dev] Mac OS X sys.platform value

M.-A. Lemburg mal@lemburg.com
Thu, 06 Dec 2001 10:08:59 +0100

"Martin v. Loewis" wrote:
> > Anyway, where sys.platform used to be "darwin1" upto and including 10.1.0 it
> > is now "darwin5" for 10.1.1 (and it will go up to "darwin6" for 10.2, etc).
> >
> > I am of a mind to take the "1" out of sys.platform, so that it becomes
> > "darwin".
> >
> > Good idea or not?
> Bad idea. Anybody comparing to "darwin1" will have to update the
> code. When they do so, they could just as well write
> sys.platform.startswith("darwin").
> The same happens on Linux, which happens to be "linux2" since Linux
> kernel version 2.x is in use. That says little about the system,
> though, since glibc version or name of the distribution may be
> relevant.

Exactly and that's why I think that version numbers in sys.platform
are plain wrong. 

There are better tools for finding out details
about the system, e.g. platform.py which you can download from my
Python pages.

> On OS X, it seems sys.platform could be used to distinguish minor
> differences. We should not take away that opportunity.

As you already noted, the information given in the current
version number is too inaccurate to be of any real value. 

Why not add platform.py to the std lib in Python 2.3 and remove
all version info from sys.platform ?!

Marc-Andre Lemburg
CEO eGenix.com Software GmbH
Consulting & Company:                           http://www.egenix.com/
Python Software:                        http://www.lemburg.com/python/