[Python-3000] PEP 3108: Standard Library Reorganization
Mike Orr
sluggoster at gmail.com
Tue Jan 2 20:16:25 CET 2007
On 1/1/07, Josiah Carlson <jcarlson at uci.edu> wrote:
> > > * stat
> > > > + ``os.stat`` now returns a tuple with attributes.
> > >
> > > The stat module also offers useful functions like stat.IS_DIR() for
> > > determining if an object is a directory.
> >
> >
> > Perhaps the functions should move to os or be part of the object returned by
> > os.stat.
>
> Methods sound better (to me) than functions in the os module. If for
> the reason that os.stat(fn).ST_ISDIR() would be easier to remember than
> os.ST_ISDIR(os.stat(fn).st_mode) .
os.path.isdir() already exists, and it does the same thing in a more
friendly way. The issue is the four functions that have no
counterpart outside the stat module: S_ISCHR, S_ISBLK, S_ISFIFO,
S_ISSOCK. These might as well be parallel to the others.
I think Jim is writing a PEP that would move all the os.path.is*()
functions into os because they access the filesystem (except
os.path.isabs()). That's a separate issue.
--
Mike Orr <sluggoster at gmail.com>
More information about the Python-3000
mailing list