[Python-ideas] IntFlags

random832 at fastmail.us random832 at fastmail.us
Fri Mar 6 14:51:07 CET 2015


On Fri, Mar 6, 2015, at 04:28, Andrew Barnert wrote:
> For example, if we were designing os.open or mmap or whatever as a
> Pythonic interface, it wouldn't have a "flags" value that or's together
> multiple integers. We'd probably have separate keyword-only arguments for
> the less common flags, etc. But they weren't designed from scratch; they
> were designed to closely mirror the POSIX APIs.

It makes me wonder what the os module would look like if Windows (or
VMS, OS/2, classic Mac, or whatever other OSes have been supported by
python in the present or past) *didn't* provide close mirrors of the
POSIX APIs as part of their C runtime library.

I mean, it's not like we have opendir and readdir. And while we do have
fork and exec, there's a reason beyond convenience for spawn. Because
those are the functions that _don't_ exist, or don't work right, on
non-Unix platforms.


More information about the Python-ideas mailing list