On 1/1/07, Josiah Carlson <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
