[Python-Dev] Updates to PEP 471, the os.scandir() proposal

Ben Hoyt benhoyt at gmail.com
Wed Jul 9 23:42:07 CEST 2014

I really don't understand why you *want* a worse, much less cross-platform API?

> Okay, so using that logic we should head over to the os module and remove:
> ctermid, getenv, getegid...
> Okay, I'm tired of typing, but that list is not even half-way through the os
> page, and those are all methods or attributes that are not available on
> either Windows or Unix or some flavors of Unix.

True, is this really the precedent we want to *aim for*. listdir() is
cross-platform, and it's relatively easy to make scandir()
cross-platform, so why not?

> Oh, and all those upper-case attributes?  Yup, documented.  And when we
> don't document it ourselves we often refer readers to their system
> documentation because Python does not, in fact, return exactly the same
> results on all platforms -- particularly when calling into the OS.

But again, why a worse, less cross-platform API when a simple,
cross-platform one is a method call away?


More information about the Python-Dev mailing list