[Python-Dev] Alternative path suggestion

Greg Ewing greg.ewing at canterbury.ac.nz
Fri May 5 02:59:24 CEST 2006


Mike Orr wrote:

> The main difficulty with this approach is it's so radical.  It would
> require a serious champion to convince people it's as good as our
> tried-and-true strings.

Another thing you would need to do is implement it for
some of the less Unix-like path syntaxes, such as Classic
MacOS and VMS, to make sure that it's feasible to fit
them into your tuple-like format.


> The question is, does forcing people to use .stat() expose an
> implementation detail that should be hidden, and does it smell of
> Unixism?  Most people think a file *is* a regular file or a directory.
>  The fact that this is encoded in the file's permission bits -- which
> stat() examines -- is a quirk of Unix.

Permission bits aren't the only thing that stat() examines.
I don't see anything wrong with having stat() be the way to
get at whatever metadata there is about a file on a platform.
And having .isdir etc. attributes on the stat() result
abstracts whether they're obtained from the permission bits
or not.

--
Greg


More information about the Python-Dev mailing list