Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #197745
| From | Lawrence D’Oliveiro <ldo@nz.invalid> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Python’s OS-specific API support |
| Date | 2026-03-25 01:32 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <10pvdv3$1i0vk$1@dont-email.me> (permalink) |
I’ve been looking at the docs for Python’s “os” module <https://docs.python.org/3/library/os.html>. This contains a collection of low-level interfaces that are specific to particular operating system platforms. And it’s turning into quite a sprawling hodge-podge of function calls and symbol definitions for use with same: I think it’s already up to about 60 printed pages. Just for a fun, I did a count of the “availability” info for various features, grouped by the platforms mentioned. My count could be a bit off by one or two, but judging from the numbers, this will not appreciably affect any ranking judgements you might want to draw. Far and away, the number-one platform supported was “Unix”, with 141 different mentions. This includes a section titled “Interface to the scheduler”, which warns it is only applicable on “some Unix platforms”, not necessarily all of them. In second place, almost neck-and-neck, are “Linux” (33 mentions) and “Windows” (32 mentions). I suppose if all the “xattr” functions had their own separate “availability” clauses (as is done in most places elsewhere), this would put Linux comfortably in the lead. And don’t forget that all the “Unix” and “POSIX” ones apply to Linux as well, with just one exception. It is interesting to note that none of the pseudo-terminal functions, and few of the ones for controlling terminals from the client side, are supported on Windows. All of these are available on “Unix”. There are also a couple of mentions of availability under “POSIX”, though I’m not sure why this is distinct from “Unix”. There is also a single mention of a macOS-specific API -- special process-priority values only available on that platform. And two places where functions are specifically mentioned as being available on particular BSD variants. The solitary “Unix” function not available on Linux is lchmod(), which is not in POSIX anyway. This is also unavailable on OpenBSD, though FreeBSD and NetBSD support it. Is this a sign of the relative popularity of those platforms for Python programming? I think it could be.
Back to comp.lang.python | Previous | Next | Find similar
Python’s OS-specific API support Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-03-25 01:32 +0000
csiph-web